Documentation
¶
Index ¶
- func AddBusinessDays(date time.Time, days int) time.Time
- func Age(birthdate time.Time) int
- func AgeAt(birthdate, reference time.Time) int
- func DaysInMonth(date time.Time) int
- func DaysInYear(date time.Time) int
- func EndOfDay(date time.Time) time.Time
- func EndOfMonth(date time.Time) time.Time
- func EndOfWeek(date time.Time) time.Time
- func EndOfYear(date time.Time) time.Time
- func IsAfter(dateA, dateB time.Time) bool
- func IsAfterOrEqual(dateA, dateB time.Time) bool
- func IsBefore(dateA, dateB time.Time) bool
- func IsBeforeOrEqual(dateA, dateB time.Time) bool
- func IsBusinessDay(date time.Time) bool
- func IsLeapDay(date time.Time) bool
- func IsLeapYear(date time.Time) bool
- func IsSameDay(dateA, dateB time.Time) bool
- func IsSameMonth(dateA, dateB time.Time) bool
- func IsSameYear(dateA, dateB time.Time) bool
- func IsWeekend(date time.Time) bool
- func Overlaps(startA, endA, startB, endB time.Time) bool
- func Parse(value string) (time.Time, error)
- func ParseWithLayout(layout, value string) (time.Time, error)
- func StartOfDay(date time.Time) time.Time
- func StartOfMonth(date time.Time) time.Time
- func StartOfWeek(date time.Time) time.Time
- func StartOfYear(date time.Time) time.Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBusinessDays ¶
AddBusinessDays returns business date in future/past by days.
- If days is zero, date is returned.
- If days is negative, date is decremented by days.
func Age ¶
Age returns birthdate years compared to time.Now().
- If time.Now() is before birthdate, 0 is returned.
func AgeAt ¶
AgeAt returns birthdate years compared to reference.
- If reference is before birthdate, 0 is returned.
func DaysInMonth ¶
DaysInMonth returns number of days in date[month].
func DaysInYear ¶ added in v1.0.1
DaysInYear returns number of days in date[year].
func IsAfterOrEqual ¶ added in v1.0.1
IsAfterOrEqual returns true if dateA is after or equal dateB.
func IsBeforeOrEqual ¶ added in v1.0.1
IsBeforeOrEqual returns true if dateA is before or equal dateB.
func IsBusinessDay ¶
IsBusinessDay returns true if date is business day.
func IsLeapYear ¶
IsLeapYear returns true if date[year] is leap.
func IsSameMonth ¶
IsSameMonth returns true if dateA[year,month] is equal dateB[year,month].
func IsSameYear ¶
IsSameYear returns true if dateA[year] is equal dateB[year].
func Parse ¶
Parse parses value into time.Time using time.RFC3339.
- If value is not valid, error is returned.
func ParseWithLayout ¶
ParseWithLayout parses value into time.Time using layout.
- If value is not valid, error is returned.
func StartOfMonth ¶
StartOfMonth returns start of date[month].
func StartOfWeek ¶
StartOfWeek returns start of date[week].
Types ¶
This section is empty.