Skip to content
Snippets Groups Projects
Commit 98b1a44e authored by James Page's avatar James Page
Browse files

Add duration constants to date_utils

parent 12143274
No related branches found
Tags v1.260.0
No related merge requests found
...@@ -436,7 +436,7 @@ func (t TradingHours) String() string { ...@@ -436,7 +436,7 @@ func (t TradingHours) String() string {
rangeDescription = fmt.Sprintf("%s – %s", rangeStartWeekday.String()[:3], currentWeekday.String()[:3]) 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 { if nextTradingHoursDay.StartTime == currentTradingHoursDay.StartTime && nextTradingHoursDay.EndTime == currentTradingHoursDay.EndTime && i < len(weekdays)-1 {
continue continue
} }
...@@ -477,3 +477,9 @@ func (day TradingHoursDay) String() string { ...@@ -477,3 +477,9 @@ func (day TradingHoursDay) String() string {
return startTime.Format("3:04pm") + " – " + endTime.Format("3:04pm") return startTime.Format("3:04pm") + " – " + endTime.Format("3:04pm")
} }
const DurationFifteenMinutes = time.Minute * 15
const DurationOneDay = time.Hour * 24
const DurationOneWeek = DurationOneDay * 7
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment