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/calcurse.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/calcurse.h') diff --git a/src/calcurse.h b/src/calcurse.h index 8626393..c6ddc8d 100644 --- a/src/calcurse.h +++ b/src/calcurse.h @@ -137,10 +137,12 @@ /* * Note the difference between the number of seconds in a day and daylength * in seconds. The two may differ when DST is in effect (daylength is either - * 23, 24 or 25 hours. The argument to DAYLEN is of type time_t. + * 23, 24 or 25 hours. The argument "date" is assumed to be of type time_t. */ #define DAYINSEC (DAYINMIN * MININSEC) -#define DAYLEN(date) (date_sec_change((date), 0, 1) - (date)) +#define NEXTDAY(date) date_sec_change((date), 0, 1) +#define DAYLEN(date) (NEXTDAY(date) - (date)) +#define ENDOFDAY(date) (NEXTDAY(date) - 1) #define HOURINSEC (HOURINMIN * MININSEC) #define MAXDAYSPERMONTH 31 @@ -760,6 +762,7 @@ int ui_calendar_get_view(void); void ui_calendar_start_date_thread(void); void ui_calendar_stop_date_thread(void); void ui_calendar_set_current_date(void); +struct date *ui_calendar_get_today(void); void ui_calendar_set_first_day_of_week(enum wday); void ui_calendar_change_first_day_of_week(void); unsigned ui_calendar_week_begins_on_monday(void); -- cgit v1.2.3-54-g00ecf