Documentation
¶
Index ¶
- func CalculateDateRange(baseDay time.Time, duration int) (startDate, endDate string)
- func CalculateWeekendRange(weekOffset int) (departureStartDate, departureEndDate, arrivalStartDate, arrivalEndDate string)
- func DetermineRangeBasedOnCurrentDay(currentDay time.Weekday) (time.Weekday, time.Weekday)
- func GetDaysOrder() ([]time.Weekday, time.Weekday, time.Weekday)
- func GetNextWeekday(baseDay time.Time, weekday time.Weekday, includeCurrent bool) time.Time
- func ListDatesBetween(start, end string) ([]string, error)
- func ShouldIncludeDay(day, startDay, endDay time.Weekday) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateDateRange ¶
CalculateDateRange generates a string representation of the start and end dates, starting from `baseDay` and lasting for `duration` days.
func CalculateWeekendRange ¶
func CalculateWeekendRange(weekOffset int) (departureStartDate, departureEndDate, arrivalStartDate, arrivalEndDate string)
CalculateWeekendRange calculates the date range for the specified weekend based on the current date and the `weekOffset` indicating which weekend to calculate. 0 = this weekend, 1 = next weekend, etc.
func DetermineRangeBasedOnCurrentDay ¶
determineRangeBasedOnCurrentDay calculates the range of days to consider based on the current day
func GetDaysOrder ¶
GetDaysOrder returns the order of days for the week based on the current day, along with startDay and endDay.
func GetNextWeekday ¶
GetNextWeekday finds the next occurrence of a specific weekday from a given day. If `includeCurrent` is true and `baseDay` is the same as `weekday`, `baseDay` will be returned.
func ListDatesBetween ¶
ListDatesBetween generates a list of dates in the format "YYYY-MM-DD" between two given dates, inclusive.
func ShouldIncludeDay ¶
shouldIncludeDay checks if a day is within the specified range
Types ¶
This section is empty.