Documentation
¶
Index ¶
- Constants
- func DateEqual(date1, date2 time.Time) bool
- func DayAndMonthEqual(date1, date2 time.Time) bool
- func IsDateInTimeGroup(date time.Time, timeGroup TimeGroup) (bool, error)
- func MaxDate(d1 time.Time, d2 time.Time) time.Time
- func MinDate(d1 time.Time, d2 time.Time) time.Time
- func MonthEqual(date1, date2 time.Time) bool
- func OnlyDateWithinRange(curDate, fromDate, toDate string) (bool, error)
- func OnlyTimeWithinRange(fromTime, toTime, curTime string) (bool, error)
- func SetSameLocale(time1 time.Time, time2 *time.Time)
- func SetTimeOfDay(date time.Time, timeOfDay string) (time.Time, error)
- func TimeBetween(from, to, date time.Time) bool
- func TimeWithinRange(from, to, date time.Time) bool
- type FormattedDate
- func (fd FormattedDate) Add(d time.Duration) time.Time
- func (fd FormattedDate) AsTime() time.Time
- func (fd FormattedDate) Expired(curDate time.Time, dateOnly bool) bool
- func (fd FormattedDate) IsZero() bool
- func (fd FormattedDate) MarshalJSON() ([]byte, error)
- func (fd *FormattedDate) UnmarshalJSON(data []byte) error
- type TimeGroup
Constants ¶
View Source
const DateFormat = "2006-01-02"
View Source
const DateTimeFormat = "2006-01-02 15:04:05"
View Source
const DateTimeFormatYYYYMMDDHHMM = "2006-01-02 15:04"
View Source
const DateTimeMsFormat = "2006-01-02 15:04:05.000"
View Source
const TimeFormat = "15:04:05"
View Source
const TimeFormatHHMM = "15:04"
Variables ¶
This section is empty.
Functions ¶
func DayAndMonthEqual ¶
func MonthEqual ¶
func OnlyDateWithinRange ¶
func OnlyTimeWithinRange ¶
copy from helpers
func SetTimeOfDay ¶
supported timeOfDay = hh:mm || hh:mm:ss
func TimeBetween ¶ added in v0.21.0
date.After(from) is "from" time (exclusive). !date.After(to) is "to" time (inclusive).
Types ¶
type FormattedDate ¶ added in v0.15.0
func (FormattedDate) AsTime ¶ added in v0.15.0
func (fd FormattedDate) AsTime() time.Time
func (FormattedDate) Expired ¶ added in v0.22.0
func (fd FormattedDate) Expired(curDate time.Time, dateOnly bool) bool
func (FormattedDate) IsZero ¶ added in v0.15.0
func (fd FormattedDate) IsZero() bool
func (FormattedDate) MarshalJSON ¶ added in v0.15.0
func (fd FormattedDate) MarshalJSON() ([]byte, error)
func (*FormattedDate) UnmarshalJSON ¶ added in v0.15.1
func (fd *FormattedDate) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.