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

Function DoesIncludeAll

libs/editor/opening_hours_ui.cpp:20–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20bool DoesIncludeAll(osmoh::Timespan const & openingTime, osmoh::TTimespans const & spans)
21{
22 if (spans.empty())
23 return true;
24
25 auto const openingTimeStart = openingTime.GetStart().GetHourMinutes().GetDuration();
26 auto const openingTimeEnd = openingTime.GetEnd().GetHourMinutes().GetDuration();
27 auto const excludeTimeStart = spans.front().GetStart().GetHourMinutes().GetDuration();
28 auto const excludeTimeEnd = spans.back().GetEnd().GetHourMinutes().GetDuration();
29
30 if (!openingTime.HasExtendedHours() && (excludeTimeStart < openingTimeStart || openingTimeEnd < excludeTimeEnd))
31 return false;
32
33 return true;
34}
35
36bool FixTimeSpans(osmoh::Timespan openingTime, osmoh::TTimespans & spans)
37{

Callers 1

FixTimeSpansFunction · 0.85

Calls 7

frontMethod · 0.80
backMethod · 0.80
HasExtendedHoursMethod · 0.80
emptyMethod · 0.45
GetDurationMethod · 0.45
GetStartMethod · 0.45
GetEndMethod · 0.45

Tested by

no test coverage detected