From 5b12a9cd1631eb2874d7a235128c130b1f5f83e2 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Fri, 13 Jan 2023 17:53:25 +0100 Subject: [PATCH] fix setting dotw --- src/utils.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils.cpp b/src/utils.cpp index 9c8caf2..d07a4f4 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -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; } }