Fix "last week" patch so that it works for 0 and 5 to match documentation

pull/55/head
Rop 7 years ago
parent de16d0b7c5
commit bc40f0d2a1

@ -334,8 +334,11 @@ namespace ezt {
if (year <= 68 ) year = 1970 + year; // fix user intent
uint8_t m = month;
uint8_t w = ordinal;
if (w == 5) ordinal = 0;
if (w == 5) { // is this a "Last week" rule?
if (w == 5) {
ordinal = 0;
w = 0;
}
if (w == 0) { // is this a "Last week" rule?
if (++m > 12) { // yes, for "Last", go to the next month
m = 1;
++year;

Loading…
Cancel
Save