diff options
author | Lukas Fleischer <lfleischer@calcurse.org> | 2017-10-26 20:44:45 +0200 |
---|---|---|
committer | Lukas Fleischer <lfleischer@calcurse.org> | 2017-10-26 20:49:30 +0200 |
commit | 760c297027efca75e095940d76d2078b1da1b677 (patch) | |
tree | 965a41a1d717c45a711691af4879255ca68492e1 /src/ui-day.c | |
parent | eddee590ec11f4c53a4e01981fa0166abb9662d2 (diff) | |
download | calcurse-760c297027efca75e095940d76d2078b1da1b677.tar.gz calcurse-760c297027efca75e095940d76d2078b1da1b677.zip |
Add parse_date_interactive()
Add a wrapper around parse_date() which picks the current input date
format as well as the currently selected day and passes both values to
parse_date(), alongside with the parameters passed to
parse_date_interactive() itself.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/ui-day.c')
-rw-r--r-- | src/ui-day.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/ui-day.c b/src/ui-day.c index 3c0547d..9c858f1 100644 --- a/src/ui-day.c +++ b/src/ui-day.c @@ -293,9 +293,8 @@ static void update_rept(struct rpt **rpt, const long start) new_date.mm = lt.tm_mon + 1; new_date.yyyy = lt.tm_year + 1900; } else { - if (!parse_date(timstr, conf.input_datefmt, &newyear, - &newmonth, &newday, - ui_calendar_get_slctd_day())) { + if (!parse_date_interactive(timstr, &newyear, + &newmonth, &newday)) { asprintf(&outstr, msg_fmts, DATEFMT_DESC(conf.input_datefmt)); status_mesg(msg_wrong_date, outstr); @@ -787,9 +786,8 @@ void ui_day_item_repeat(void) until_date.dd = lt.tm_mday; until_date.mm = lt.tm_mon + 1; until_date.yyyy = lt.tm_year + 1900; - } else if (parse_date(user_input, conf.input_datefmt, - &year, &month, &day, - ui_calendar_get_slctd_day())) { + } else if (parse_date_interactive(user_input, &year, &month, + &day)) { t = p->start; localtime_r(&t, <); until_date.dd = day; |