commit fb144bc35837f496d95cb3791185daacf360bf09
parent 57591b390d7c7556e2e5c309ea86bda49b3e6bcd
Author: Andreas Gruhler <agruhl@gmx.ch>
Date: Wed, 24 Nov 2021 21:00:34 +0100
use tm.tm_mday to count days
Diffstat:
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/diary.c b/src/diary.c
@@ -726,9 +726,8 @@ int main(int argc, char** argv) {
}
fprintf(stderr, "Diff days: %i\n", diff_days);
-
- const time_t ONE_DAY = 24 * 60 * 60 ;
- time_t new_date = mktime(&curs_date) + (diff_days * ONE_DAY);
+ curs_date.tm_mday += diff_days;
+ time_t new_date = mktime(&curs_date);
mv_valid = go_to(cal, aside, new_date, &pad_pos, &curs_date, &cal_start, &cal_end);
}
} else if (event.bstate & BUTTON5_PRESSED) {