diff --git a/src/ui.c b/src/ui.c index 045b937..56658bc 100644 --- a/src/ui.c +++ b/src/ui.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #ifdef _WIN32 @@ -24,6 +25,7 @@ int main(void) { int taskdeadline_date = 0; int taskpriority = 0; int taskspare = 0; + char *taskname = NULL; // taskName Buffer llist *listT = NULL; llist *listE = NULL; @@ -44,7 +46,7 @@ int main(void) { continue; }; - char *taskname = NULL; // taskName Buffer + taskname = NULL; size_t nameLen; size_t nnread; switch (choice) { @@ -96,7 +98,11 @@ int main(void) { scanf("%d", &taskspare); // if list exists use it to generate plan if (listT != NULL) { - listE = genPlan(listT, taskspare); + struct tm lc; + localtime_r(&now, &lc); + lc.tm_hour += taskspare; + time_t avail = mktime(&lc); + listE = genPlan(listT, avail); write_linkedlist_to_csv(listT, dbName); } else { printf("list is empty!");