dates

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

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 DateEqual

func DateEqual(date1, date2 time.Time) bool

copy from helpers

func DayAndMonthEqual

func DayAndMonthEqual(date1, date2 time.Time) bool

func IsDateInTimeGroup

func IsDateInTimeGroup(date time.Time, timeGroup TimeGroup) (bool, error)

func MaxDate

func MaxDate(d1 time.Time, d2 time.Time) time.Time

func MinDate

func MinDate(d1 time.Time, d2 time.Time) time.Time

func MonthEqual

func MonthEqual(date1, date2 time.Time) bool

func OnlyDateWithinRange

func OnlyDateWithinRange(curDate, fromDate, toDate string) (bool, error)

func OnlyTimeWithinRange

func OnlyTimeWithinRange(fromTime, toTime, curTime string) (bool, error)

copy from helpers

func SetSameLocale

func SetSameLocale(time1 time.Time, time2 *time.Time)

func SetTimeOfDay

func SetTimeOfDay(date time.Time, timeOfDay string) (time.Time, error)

supported timeOfDay = hh:mm || hh:mm:ss

func TimeBetween added in v0.21.0

func TimeBetween(from, to, date time.Time) bool

date.After(from) is "from" time (exclusive). !date.After(to) is "to" time (inclusive).

func TimeWithinRange

func TimeWithinRange(from, to, date time.Time) bool

copy from helpers

Types

type FormattedDate added in v0.15.0

type FormattedDate time.Time

func (FormattedDate) Add added in v0.15.0

func (fd FormattedDate) Add(d time.Duration) time.Time

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

type TimeGroup

type TimeGroup struct {
	Dates            []string
	DatesFilterType  string
	DatesFilterFrame string
	TimeRange        []string
	DaysOfWeek       []string
	DueDateEndTime   string
}

Jump to

Keyboard shortcuts

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