fix setting dotw
This commit is contained in:
parent
e9fef4f4d3
commit
5b12a9cd16
1 changed files with 3 additions and 0 deletions
|
@ -261,11 +261,14 @@ void add_one_day(datetime_t &dt) {
|
|||
dt.year += 1;
|
||||
dt.month = 1;
|
||||
dt.day = 1;
|
||||
dt.dotw = (dt.dotw + 1) % 7;
|
||||
} else if (dt.day == daysPerMonth[dt.month]) {
|
||||
dt.month = (dt.month + 1) % 12;
|
||||
dt.day = 1;
|
||||
dt.dotw = (dt.dotw + 1) % 7;
|
||||
} else {
|
||||
dt.day += 1;
|
||||
dt.dotw = (dt.dotw + 1) % 7;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue