date

package
v0.0.208 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2025 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	YKey   = "y"
	MKey   = "m"
	DKey   = "d"
	HKey   = "h"
	MinKey = "min"
	TzKey  = "tz"
)
View Source
const (
	UTCKey = "utc"
)

Variables

This section is empty.

Functions

func DKeyFn added in v0.0.186

func DKeyFn(prefix string) string

func HKeyFn added in v0.0.186

func HKeyFn(prefix string) string

func Idx added in v0.0.30

func Idx() []contract.IndexEntry

func IdxSrch added in v0.0.30

func IdxSrch() []contract.SearchIndexEntry

func MKeyFn added in v0.0.186

func MKeyFn(prefix string) string

func MinKeyFn added in v0.0.186

func MinKeyFn(prefix string) string

func Rules added in v0.0.24

func TzKeyFn added in v0.0.186

func TzKeyFn(prefix string) string

func YKeyFn added in v0.0.186

func YKeyFn(prefix string) string

Types

type Comp

type Comp struct {
	UTC *time.Time `json:"utc" validate:"nnpt,utc"`
}

func (*Comp) GetUTC added in v0.0.118

func (c *Comp) GetUTC() time.Time

func (*Comp) SetUTC added in v0.0.118

func (c *Comp) SetUTC(x time.Time)

type Core

type Core struct {
	contract.Dt `bson:",inline" validate:"recurse"`
}

func ApplyCore

func ApplyCore(c *Core, modifiers ...CoreOption) Core

type CoreOption

type CoreOption = contracti.CoreOption[Core]

func WithDt added in v0.0.118

func WithDt(x contract.Dt) CoreOption

type Date

type Date struct {
	Meta `bson:",inline" validate:"recurse"`
	Comp `bson:",inline" validate:"recurse"`
	Core `bson:",inline" validate:"recurse"`
}

Date represents a date optimized for handling multiple time zones, and query parameter filtering.

func Mock added in v0.0.42

func Mock() *Date

func New added in v0.0.15

func New(m Meta, cr Core) *Date

func Zero added in v0.0.122

func Zero() *Date

func (*Date) Compute added in v0.0.33

func (d *Date) Compute(ctx context.Context, op contract.Geocoder) error

type Meta

type Meta struct{}

func ApplyMeta

func ApplyMeta(m *Meta, modifiers ...MetaOption) Meta

type MetaOption

type MetaOption = contract.MetaOption[Meta]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL