From c8af480f52b46e556d23ef012f3987aa3a0fc25b Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 11 Jan 2011 22:10:48 +0000 Subject: Make parse_date accept several short forms. Short forms are only accepted in interactive mode (e.g. when using the "Go to" function, editing a recurrent item's end date, and so on). Samples: "1/1/30" for "01/01/2030", "26" for the 26th of the currently selected month/year or "3/1" for Mar 01 (or Jan 03, depending on the date format) of the currently selected year. --- src/calendar.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/calendar.c') diff --git a/src/calendar.c b/src/calendar.c index 085a239..c5aeae8 100755 --- a/src/calendar.c +++ b/src/calendar.c @@ -1,4 +1,4 @@ -/* $calcurse: calendar.c,v 1.38 2010/10/23 10:19:47 culot Exp $ */ +/* $calcurse: calendar.c,v 1.39 2011/01/11 22:10:48 fleischer Exp $ */ /* * Calcurse - text-based organizer @@ -646,11 +646,8 @@ calendar_change_day (int datefmt) wrong_day = 0; calendar_goto_today (); } - else if (strlen (selected_day) != LDAY - 1) - { - wrong_day = 1; - } - else if (parse_date (selected_day, datefmt, &dyear, &dmonth, &dday)) + else if (parse_date (selected_day, datefmt, &dyear, &dmonth, &dday, + calendar_get_slctd_day ())) { wrong_day = 0; /* go to chosen day */ -- cgit v1.2.3