From 4cad9896baf2c56abf05e8b1c5824b79e9324230 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 30 Sep 2008 16:00:01 +0000 Subject: [PATCH] Maximum length of a date input field is now 10 characters. I also noticed that the datepicker.js seems to have been discontinued by its author. Due to this plus some shortcomings we may want to consider forking it and integrating it more tightly into the WebCit framework. --- webcit/calendar_tools.c | 2 +- webcit/event.c | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/webcit/calendar_tools.c b/webcit/calendar_tools.c index 3e946d945..7c47b0d3f 100644 --- a/webcit/calendar_tools.c +++ b/webcit/calendar_tools.c @@ -64,7 +64,7 @@ void display_icaltimetype_as_webform(struct icaltimetype *t, char *prefix, int d wprintf(prefix); wprintf("\" id=\""); wprintf(prefix); - wprintf("\" value=\""); + wprintf("\" size=\"10\" maxlength=\"10\" value=\""); wc_strftime(timebuf, 32, "%Y-%m-%d", &tm); wprintf(timebuf); wprintf("\">"); diff --git a/webcit/event.c b/webcit/event.c index 86014aaba..c8e60639d 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -402,6 +402,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, /* blank recurrence with some sensible defaults */ memset(&recur, 0, sizeof(struct icalrecurrencetype)); recur.count = 3; + recur.until = icaltime_null_time(); recur.interval = 1; recur.freq = ICAL_WEEKLY_RECURRENCE; } @@ -491,8 +492,9 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, wprintf("\n"); - - // FIXME preselect the correct radio button + int which_rrend_is_preselected = 0; + if (!icaltime_is_null_time(recur.until)) which_rrend_is_preselected = 2; + if (recur.count > 0) which_rrend_is_preselected = 1; wprintf(""); wprintf(_("Recurrence range")); @@ -500,13 +502,13 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, wprintf("", - (1 ? "checked" : "") + ((which_rrend_is_preselected == 0) ? "checked" : "") ); wprintf("%s
\n", _("No ending date")); wprintf("", - (0 ? "checked" : "") + ((which_rrend_is_preselected == 1) ? "checked" : "") ); wprintf(_("Repeat this event")); wprintf(" "); @@ -517,7 +519,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, wprintf("", - (0 ? "checked" : "") + ((which_rrend_is_preselected == 2) ? "checked" : "") ); wprintf(_("Repeat this event until ")); wprintf(""); -- 2.30.2