From bcb08c6da9ca6b3f1662a221565380b2a435db81 Mon Sep 17 00:00:00 2001 From: ketrptr Date: Mon, 16 Dec 2024 17:35:23 +0100 Subject: [PATCH] modified: src/ui.c --- src/ui.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ui.c b/src/ui.c index dcd0745..9ee8959 100644 --- a/src/ui.c +++ b/src/ui.c @@ -19,6 +19,9 @@ #define localtime_r(T, Tm) (localtime_s(Tm, T) ? NULL : Tm) #endif +#define minutes(n) (60 * n) +#define hours(n) (60 * minutes(n)) +#define days(n) (24 * hours(n)) const char *dbName = "db.csv"; int main(void) { @@ -83,8 +86,7 @@ int main(void) { // } // create deadline timestamp - lc.tm_hour += (taskdeadline_date * 24); - time_t deadline = mktime(&lc); + time_t deadline = now + days(taskdeadline_date); Task *newT = newTask(taskname, now, deadline, taskpriority, 0); if (listT == NULL) { listT = llistNew(newT, cmpTaskN);