From 98b1a44ee6c146b919b33a99d457eed0297d79cf Mon Sep 17 00:00:00 2001 From: James Page <james@bob.co.za> Date: Fri, 13 Dec 2024 13:42:15 +0200 Subject: [PATCH] Add duration constants to date_utils --- date_utils/date_utils.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/date_utils/date_utils.go b/date_utils/date_utils.go index 3893eff..66cc983 100644 --- a/date_utils/date_utils.go +++ b/date_utils/date_utils.go @@ -436,7 +436,7 @@ func (t TradingHours) String() string { rangeDescription = fmt.Sprintf("%s – %s", rangeStartWeekday.String()[:3], currentWeekday.String()[:3]) } - // If the next day has the same times and we're not at the last element, we continue the current range + // If the next day has the same times, and we're not at the last element, we continue the current range. if nextTradingHoursDay.StartTime == currentTradingHoursDay.StartTime && nextTradingHoursDay.EndTime == currentTradingHoursDay.EndTime && i < len(weekdays)-1 { continue } @@ -477,3 +477,9 @@ func (day TradingHoursDay) String() string { return startTime.Format("3:04pm") + " – " + endTime.Format("3:04pm") } + +const DurationFifteenMinutes = time.Minute * 15 + +const DurationOneDay = time.Hour * 24 + +const DurationOneWeek = DurationOneDay * 7 -- GitLab