times

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseTime added in v0.14.0

func ParseTime(value string) (result time.Time, err error)

Types

type Date added in v1.1.0

type Date struct {
	Year  int
	Month time.Month
	Day   int
}

func DataOf added in v1.2.0

func DataOf(t time.Time) Date

func DateNow added in v1.1.0

func DateNow() Date

func NewDate added in v1.1.0

func NewDate(year int, month time.Month, day int) Date

func (Date) IsZero added in v1.1.0

func (d Date) IsZero() (ok bool)

func (Date) MarshalJSON added in v1.1.0

func (d Date) MarshalJSON() ([]byte, error)

func (*Date) Scan added in v1.1.0

func (d *Date) Scan(src interface{}) error

func (Date) String added in v1.1.0

func (d Date) String() string

func (Date) ToTime added in v1.1.0

func (d Date) ToTime() time.Time

func (*Date) UnmarshalJSON added in v1.1.0

func (d *Date) UnmarshalJSON(p []byte) error

func (Date) Value added in v1.2.0

func (d Date) Value() (driver.Value, error)

type DateRange

type DateRange struct {
	// Beg
	// @title Beg
	// @description `2006-01-01`
	Beg Date `json:"beg"`
	// End
	// @title End
	// @description `2006-01-01`
	End Date `json:"end"`
}

DateRange @title DateRange @description `['2006-01-01', '2006-01-01')`

func NewDateRange added in v0.14.0

func NewDateRange(left Date, right Date) (v *DateRange)

func (*DateRange) IsZero

func (dr *DateRange) IsZero() (ok bool)

type Time added in v1.1.0

type Time struct {
	Hour    int
	Minutes int
	Second  int
}

func NewTime added in v1.1.0

func NewTime(hour int, min int, sec int) Time

func TimeNow added in v1.1.0

func TimeNow() Time

func TimeOf added in v1.2.0

func TimeOf(t time.Time) Time

func (Time) IsZero added in v1.1.0

func (t Time) IsZero() (ok bool)

func (Time) MarshalJSON added in v1.1.0

func (t Time) MarshalJSON() ([]byte, error)

func (*Time) Scan added in v1.1.0

func (t *Time) Scan(src interface{}) error

func (Time) String added in v1.1.0

func (t Time) String() string

func (Time) ToTime added in v1.1.0

func (t Time) ToTime() time.Time

func (*Time) UnmarshalJSON added in v1.1.0

func (t *Time) UnmarshalJSON(p []byte) error

func (Time) Value added in v1.2.0

func (t Time) Value() (driver.Value, error)

type TimeRange

type TimeRange struct {
	// Beg
	// @title Beg
	// @description `2006-01-01T15:04:06Z`
	Beg time.Time `json:"beg"`
	// End
	// @title End
	// @description `2006-01-01T15:04:06Z`
	End time.Time `json:"end"`
}

TimeRange @title TimeRange @description `['2006-01-01T15:04:06Z', '2006-01-01T15:04:06Z')`

func NewTimeRange added in v0.14.0

func NewTimeRange(left time.Time, right time.Time) (v *TimeRange)

func (*TimeRange) IsZero

func (tr *TimeRange) IsZero() (ok bool)

Jump to

Keyboard shortcuts

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