modified: src/ui.c
parent
e5b5fd3b50
commit
bcb08c6da9
6
src/ui.c
6
src/ui.c
|
@ -19,6 +19,9 @@
|
||||||
#define localtime_r(T, Tm) (localtime_s(Tm, T) ? NULL : Tm)
|
#define localtime_r(T, Tm) (localtime_s(Tm, T) ? NULL : Tm)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define minutes(n) (60 * n)
|
||||||
|
#define hours(n) (60 * minutes(n))
|
||||||
|
#define days(n) (24 * hours(n))
|
||||||
const char *dbName = "db.csv";
|
const char *dbName = "db.csv";
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
|
@ -83,8 +86,7 @@ int main(void) {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// create deadline timestamp
|
// create deadline timestamp
|
||||||
lc.tm_hour += (taskdeadline_date * 24);
|
time_t deadline = now + days(taskdeadline_date);
|
||||||
time_t deadline = mktime(&lc);
|
|
||||||
Task *newT = newTask(taskname, now, deadline, taskpriority, 0);
|
Task *newT = newTask(taskname, now, deadline, taskpriority, 0);
|
||||||
if (listT == NULL) {
|
if (listT == NULL) {
|
||||||
listT = llistNew(newT, cmpTaskN);
|
listT = llistNew(newT, cmpTaskN);
|
||||||
|
|
Loading…
Reference in New Issue