| 160 | } |
| 161 | |
| 162 | unsigned int GameTime::getLastDayOfCurrentWeek() const |
| 163 | { |
| 164 | const unsigned short dayOfWeek = getPtime(this->ticks).date().day_of_week(); |
| 165 | unsigned int daysBeforeWeekEnd = 7 - dayOfWeek; |
| 166 | if (dayOfWeek == 0) // Already sunday |
| 167 | daysBeforeWeekEnd = 0; |
| 168 | |
| 169 | return getPtime(this->ticks + (daysBeforeWeekEnd * TICKS_PER_DAY)).date().year_month_day().day; |
| 170 | } |
| 171 | |
| 172 | unsigned int GameTime::getLastDayOfCurrentMonth() const |
| 173 | { |
no test coverage detected