aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorEl-BG-1970 <elouan.gros.fr@gmail.com>2021-10-14 13:03:23 +0200
committerEl-BG-1970 <elouan.gros.fr@gmail.com>2021-10-14 13:03:23 +0200
commitea9940af5210e52367dcce24d144c163a71b7720 (patch)
treea6bd4c17f1c65fcc31256e730a445d1431901910 /main.c
parent0226c9339c42c5a519dc545e42cc123cf30b5218 (diff)
downloadorg-to-conky-ea9940af5210e52367dcce24d144c163a71b7720.tar.gz
added [TODAY] and [TOMORROW] labels
Diffstat (limited to 'main.c')
-rw-r--r--main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/main.c b/main.c
index 7b111c8..a5c300a 100644
--- a/main.c
+++ b/main.c
@@ -73,15 +73,20 @@ int main(int argc, char **argv) {
// format nicely
char *e;
Date td = today();
+ Date tm = tomorrow(td);
Date nw = nextweek(td);
- Date last_date = (struct Date){ -1, -1, -1 };//agenda[0].date;
+ Date last_date = (struct Date){ -1, -1, -1 };
for (int i = 0; i < idx; i++) {
if (!eql(agenda[i].date, last_date)) {
last_date = agenda[i].date;
if (!zero(last_date)) {
e = print_date_to_string(last_date);
- if (smaller(last_date, td))
+ if (strictly_smaller(last_date, td))
printf("\n%s [OUTATIME]:\n", e);
+ else if (eql(last_date, td))
+ printf("\n%s [TODAY]:\n", e);
+ else if (eql(last_date, tm))
+ printf("\n%s [TOMORROW]:\n", e);
else if (smaller(last_date, nw))
printf("\n%s:\n", e);
free(e);