| 111 | using Weekdays = std::vector<osmoh::Weekday>; |
| 112 | |
| 113 | std::vector<Weekdays> SplitIntoIntervals(editor::ui::OpeningDays const & days) |
| 114 | { |
| 115 | ASSERT_GREATER(days.size(), 0, ("At least one day must present.")); |
| 116 | std::vector<Weekdays> result; |
| 117 | auto const & noInversionDays = RemoveInversion(days); |
| 118 | ASSERT(!noInversionDays.empty(), ()); |
| 119 | |
| 120 | auto previous = *begin(noInversionDays); |
| 121 | result.push_back({previous}); |
| 122 | |
| 123 | for (auto it = next(begin(noInversionDays)); it != end(noInversionDays); ++it) |
| 124 | { |
| 125 | if (NextWeekdayNumber(previous) != WeekdayNumber(*it)) |
| 126 | result.push_back({}); |
| 127 | result.back().push_back(*it); |
| 128 | previous = *it; |
| 129 | } |
| 130 | |
| 131 | return result; |
| 132 | } |
| 133 | |
| 134 | osmoh::Weekdays MakeWeekdays(editor::ui::TimeTable const & tt) |
| 135 | { |
no test coverage detected