summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2023-07-04 17:59:48 -0700
committerLouie S <louie@example.com>2023-07-04 17:59:48 -0700
commit0bf5e72a2ee87af0e7ac3e2b769359084829a20f (patch)
treecc36f2451cf8fa8d27ffd680b8dbc6d08f39c1a7 /src/main.c
parented11c16d6687b0b51d41a598b93d7923331a3853 (diff)
Fix date on entries
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/main.c b/src/main.c
index c447047..70e4516 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <string.h>
#include "db.h"
#include "draw.h"
@@ -13,6 +14,7 @@ int main() {
db_init();
groups = db_load_groups(&group_count);
+ entries = db_load_entries(&entry_count);
for(int i = 0; i < group_count; ++i) {
fprintf(stderr, "group %d:\n", i+1);
@@ -22,22 +24,28 @@ int main() {
fprintf(stderr, "\t Url: %s\n", group_get_url(&(groups[i])));
}
- /*
+ // DEBUG
+ char due_date[BUF_LEN];
for(int i = 0; i < entry_count; ++i) {
fprintf(stderr, "entry %d:\n", i+1);
- fprintf(stderr, "\t ID: %d\n", group_get_id(&(groups[i])));
- fprintf(stderr, "\tName: %s\n", group_get_name(&(groups[i])));
- fprintf(stderr, "\tDesc: %s\n", group_get_desc(&(groups[i])));
- fprintf(stderr, "\t Url: %s\n", group_get_url(&(groups[i])));
+ fprintf(stderr, "\t ID: %d\n", entry_get_id(&(entries[i])));
+ fprintf(stderr, "\t Group ID: %d\n", entry_get_group_id(&(entries[i])));
+ memset(due_date, 0, BUF_LEN);
+ if(entry_get_due_date(&(entries[i])) != NULL)
+ strftime(due_date, BUF_LEN, "%F", entry_get_due_date(&(entries[i])));
+ fprintf(stderr, "\t Due date: %s\n", due_date);
+ fprintf(stderr, "\tAlt due date: %s\n", entry_get_alt_due_date(&(entries[i])));
+ fprintf(stderr, "\t Title: %s\n", entry_get_title(&(entries[i])));
+ fprintf(stderr, "\t Color: %s\n", entry_get_color(&(entries[i])));
+ fprintf(stderr, "\t Highlight: %s\n", entry_get_highlight(&(entries[i])));
+ fprintf(stderr, "\t Done: %d\n", entry_get_done(&(entries[i])));
+ fprintf(stderr, "\t Url: %s\n", entry_get_url(&(entries[i])));
}
- */
-
- entries = db_load_entries(&entry_count);
if(groups == NULL) perror("could not get groups");
if(entries == NULL) perror("could not get entries");
- tui_init(&groups, group_count, &entries, entry_count);
+ //tui_init(&groups, group_count, &entries, entry_count);
return 0;
}