Added init_date function
This commit is contained in:
parent
833c8f6d17
commit
49d46e5ddb
15
src/dodo.c
15
src/dodo.c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user