Documentation ¶
Index ¶
- func Backwards(typ DateRangeType, end time.Time, n int) []time.Time
- func BackwardsN(typ DateRangeType, n int) []time.Time
- func BackwardsToMonday(end time.Time) []time.Time
- func Between(start, end time.Time) []time.Time
- func GetMonthStart(now time.Time) time.Time
- func GetWeekDate(now time.Time, weekday, start, end time.Weekday) time.Time
- func GetWeekEnd(now time.Time, endWeekday time.Weekday) time.Time
- func GetWeekStart(now time.Time, startWeekday time.Weekday) time.Time
- func GetWeekdays(now time.Time, startWeekday, endWeekday time.Weekday) (dates []time.Time)
- func GetYearStart(now time.Time) time.Time
- func RangeDate(start, end time.Time) func() time.Time
- type DateRangeType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Backwards ¶
Backwards returns a list of dates between "end" and -n (years, months, weeks or days).
func BackwardsN ¶
func BackwardsN(typ DateRangeType, n int) []time.Time
BackwardsN returns the dates from back to "n" years, months, weeks or days from today.
func BackwardsToMonday ¶
BackwardsToMonday returns the dates between "end" (including "end") until the previous monday of the current week (including monday).
func GetMonthStart ¶
GetMonthStart returns the date of the first month day of the current now's month.
func GetWeekEnd ¶
GetWeekEnd returns the date of the last week day (endWeekday) of the current now's week.
func GetWeekStart ¶
GetWeekStart returns the date of the first week day (startWeekday) of the current now's week.
func GetWeekdays ¶
GetWeekdays returns the range between "startWeekday" and "endWeekday" of the current week.
func GetYearStart ¶
GetYearStart returns the date of the first year of the current now's year.
Types ¶
type DateRangeType ¶
type DateRangeType string
const ( DayRange DateRangeType = "day" MonthRange DateRangeType = "month" WeekRange DateRangeType = "week" YearRange DateRangeType = "year" )