|
Lines 148-154
format_date_and_time_x (struct tm *date
Link Here
|
| 148 |
|
148 |
|
| 149 |
/* Calculate a normalized "tomorrow" */ |
149 |
/* Calculate a normalized "tomorrow" */ |
| 150 |
tomorrow_tm = *current_tm; |
150 |
tomorrow_tm = *current_tm; |
| 151 |
if (tomorrow_tm.tm_mday == time_days_in_month (date_tm->tm_year + 1900, date_tm->tm_mon - 1)) { |
151 |
if (tomorrow_tm.tm_mday == time_days_in_month (date_tm->tm_year + 1900, date_tm->tm_mon)) { |
| 152 |
tomorrow_tm.tm_mday = 1; |
152 |
tomorrow_tm.tm_mday = 1; |
| 153 |
if (tomorrow_tm.tm_mon == 11) { |
153 |
if (tomorrow_tm.tm_mon == 11) { |
| 154 |
tomorrow_tm.tm_mon = 1; |
154 |
tomorrow_tm.tm_mon = 1; |
|
Lines 162-169
format_date_and_time_x (struct tm *date
Link Here
|
| 162 |
|
162 |
|
| 163 |
/* Calculate a normalized "next seven days" */ |
163 |
/* Calculate a normalized "next seven days" */ |
| 164 |
week_tm = *current_tm; |
164 |
week_tm = *current_tm; |
| 165 |
if (week_tm.tm_mday + 6 > time_days_in_month (date_tm->tm_year + 1900, date_tm->tm_mon - 1)) { |
165 |
if (week_tm.tm_mday + 6 > time_days_in_month (date_tm->tm_year + 1900, date_tm->tm_mon)) { |
| 166 |
week_tm.tm_mday = (week_tm.tm_mday + 6) % time_days_in_month (date_tm->tm_year + 1900, date_tm->tm_mon - 1); |
166 |
week_tm.tm_mday = (week_tm.tm_mday + 6) % time_days_in_month (date_tm->tm_year + 1900, date_tm->tm_mon); |
| 167 |
if (week_tm.tm_mon == 11) { |
167 |
if (week_tm.tm_mon == 11) { |
| 168 |
week_tm.tm_mon = 1; |
168 |
week_tm.tm_mon = 1; |
| 169 |
week_tm.tm_year++; |
169 |
week_tm.tm_year++; |