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);