From 620c4eeca5cd1dda90a26527aa6d782edb1b5271 Mon Sep 17 00:00:00 2001 From: Lars Henriksen Date: Sat, 1 Dec 2018 19:54:14 +0100 Subject: CLI: Revert to and update of parse_datetimearg() An earlier commit ("CLI: take input date format from configuration file, do not accept time") replaced parse_datetimearg() with parse_datearg() and eliminated time-of-day from command line date arguments. This made the full use of filter options impossible. That earlier commit is reverted and updated. The parse_datearg() function is replaced by an updated parse_datetimearg() function that - takes the date format from the configuration file - accepts date, date-time or time The updated parse_datetimearg() function has been extended to report back the type of the date string received in order to set (filter) options correctly. Input dates for query ranges (--from, --to, --days) are still limited to dates only. Signed-off-by: Lars Henriksen Signed-off-by: Lukas Fleischer --- src/ui-calendar.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/ui-calendar.c') diff --git a/src/ui-calendar.c b/src/ui-calendar.c index a668efb..407f294 100644 --- a/src/ui-calendar.c +++ b/src/ui-calendar.c @@ -144,6 +144,12 @@ void ui_calendar_set_current_date(void) pthread_mutex_unlock(&date_thread_mutex); } +/* Return the current date. */ +struct date *ui_calendar_get_today(void) +{ + return &today; +} + /* Needed to display sunday or monday as the first day of week in calendar. */ void ui_calendar_set_first_day_of_week(enum wday first_day) { -- cgit v1.2.3-54-g00ecf