MCPcopy Create free account
hub / github.com/comaps/comaps / NormalizeExtendedEnd

Function NormalizeExtendedEnd

3party/opening_hours/rules_evaluation.cpp:123–129  ·  view source on GitHub ↗

Transform timspan with extended end of the form of time less than 24 hours to extended form, i.e from 25 to 48 hours. Example: 12:15-06:00 -> 12:15-30:00.

Source from the content-addressed store, hash-verified

121// time less than 24 hours to extended form, i.e from 25 to 48 hours.
122// Example: 12:15-06:00 -> 12:15-30:00.
123void NormalizeExtendedEnd(osmoh::Timespan & span)
124{
125 auto & endHourMinutes = span.GetEnd().GetHourMinutes();
126 auto const duration = endHourMinutes.GetDuration();
127 if (duration < 24_h)
128 endHourMinutes.SetDuration(duration + 24_h);
129}
130
131osmoh::TTimespans SplitExtendedHours(osmoh::Timespan span)
132{

Callers 1

SplitExtendedHoursFunction · 0.85

Calls 3

SetDurationMethod · 0.80
GetEndMethod · 0.45
GetDurationMethod · 0.45

Tested by

no test coverage detected