Added init_date function

This commit is contained in:
xavi 2024-09-24 21:12:20 -07:00
parent 833c8f6d17
commit 49d46e5ddb

View File

@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#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;