diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-18 11:24:49 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-18 11:24:49 +0200 |
commit | 21f6248a3dc906a0c296b937dd1aa697784e6ea3 (patch) | |
tree | 8e35b420d939d75c623bcbd54ec28b2073c1e8b3 /src/ui/sidebarwidget.c | |
parent | 04da6153af1841effecc83b7e11c4e9ba1fb163a (diff) |
SidebarWidget: Today's date says "Today"
Diffstat (limited to 'src/ui/sidebarwidget.c')
-rw-r--r-- | src/ui/sidebarwidget.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index 21ef465c..802669c7 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c | |||
@@ -167,7 +167,12 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) { | |||
167 | on = entryDate; | 167 | on = entryDate; |
168 | iSidebarItem *sep = new_SidebarItem(); | 168 | iSidebarItem *sep = new_SidebarItem(); |
169 | sep->listItem.isSeparator = iTrue; | 169 | sep->listItem.isSeparator = iTrue; |
170 | iString *text = format_Date(&on, on.year == thisYear ? "%b. %d" : "%b. %d, %Y"); | 170 | iString *text = format_Date(&on, on.year == today.year ? "%b. %d" : "%b. %d, %Y"); |
171 | if (today.year == on.year && | ||
172 | today.month == on.month && | ||
173 | today.day == on.day) { | ||
174 | appendCStr_String(text, " \u2014 Today"); | ||
175 | } | ||
171 | set_String(&sep->meta, text); | 176 | set_String(&sep->meta, text); |
172 | delete_String(text); | 177 | delete_String(text); |
173 | addItem_ListWidget(d->list, sep); | 178 | addItem_ListWidget(d->list, sep); |