Documentation
¶
Index ¶
- Constants
- type Date
- func (d Date) AddDate(year, month, day int) Date
- func (d Date) Equal(other Date) bool
- func (d Date) Greater(other Date) bool
- func (d Date) GreaterEqual(other Date) bool
- func (d Date) Lower(other Date) bool
- func (d Date) LowerEqual(other Date) bool
- func (d Date) MarshalJSON() ([]byte, error)
- func (d *Date) Scan(src interface{}) error
- func (d Date) String() string
- func (d Date) Value() (driver.Value, error)
- type DateTime
- func (d DateTime) Add(duration time.Duration) DateTime
- func (d DateTime) AddDate(year, month, day int) DateTime
- func (d DateTime) Equal(other DateTime) bool
- func (d DateTime) Greater(other DateTime) bool
- func (d DateTime) GreaterEqual(other DateTime) bool
- func (d DateTime) Lower(other DateTime) bool
- func (d DateTime) LowerEqual(other DateTime) bool
- func (d DateTime) MarshalJSON() ([]byte, error)
- func (d *DateTime) Scan(src interface{}) error
- func (d DateTime) String() string
- func (d DateTime) ToDate() Date
- func (d DateTime) Value() (driver.Value, error)
Constants ¶
View Source
const ( // DefaultServerDateFormat is the Go layout for Date objects DefaultServerDateFormat = "2006-01-02" // DefaultServerDateTimeFormat is the Go layout for DateTime objects DefaultServerDateTimeFormat = "2006-01-02 15:04:05" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Date ¶
Date type that JSON marshal and unmarshals as "YYYY-MM-DD"
func ParseDate ¶
ParseDate returns a date from the given string value that is formatted with layout.
func (Date) GreaterEqual ¶
GreaterEqual returns true if d is greater than or equal to other
func (Date) LowerEqual ¶
LowerEqual returns true if d is lower than or equal to other
type DateTime ¶
DateTime type that JSON marshals and unmarshals as "YYYY-MM-DD HH:MM:SS"
func ParseDateTime ¶
ParseDateTime returns a datetime from the given string value that is formatted with layout.
func (DateTime) GreaterEqual ¶
GreaterEqual returns true if d is greater than or equal to other
func (DateTime) LowerEqual ¶
LowerEqual returns true if d is lower than or equal to other
func (DateTime) MarshalJSON ¶
MarshalJSON for DateTime type
Click to show internal directories.
Click to hide internal directories.