From 49d46e5ddba6a8e29dfb0eb54d65c8b13b2ebf58 Mon Sep 17 00:00:00 2001 From: xavi Date: Tue, 24 Sep 2024 21:12:20 -0700 Subject: [PATCH] Added init_date function --- src/dodo.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/dodo.c b/src/dodo.c index 3214e6c..c50322e 100644 --- a/src/dodo.c +++ b/src/dodo.c @@ -1,5 +1,6 @@ #include #include +#include #include "sqlite3.h" #include "x_string.h" #include "x_curses.h" @@ -30,6 +31,20 @@ int view_all(sqlite3 *db){ return rc; } +int init_date(date *d){ + time_t rawtime; + time(&rawtime); + + struct tm *local = localtime(&rawtime); + + d->year = local->tm_year + 1900; + d->month = local->tm_mon; + d->year = local->tm_mday; + + return 0; + +} + void init_filtered_tasks(filtered_tasks* task){ task->selected_columns = NULL; task->title = NULL;