Maximum length of a date input field is now 10 characters.
authorArt Cancro <ajc@citadel.org>
Tue, 30 Sep 2008 16:00:01 +0000 (16:00 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 30 Sep 2008 16:00:01 +0000 (16:00 +0000)
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
webcit/event.c

index 3e946d945fdcc7ea23dae04d835292e9031e1439..7c47b0d3f129713014f87eee754e447b7c034bc4 100644 (file)
@@ -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("\">");
index 86014aaba470df76b5b7b3eb9e7dfe5056d2ebab..c8e60639db818da0fc6a82d77795bd2ef82395d3 100644 (file)
@@ -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("</td></tr>\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("<tr><td><b>");
        wprintf(_("Recurrence range"));
@@ -500,13 +502,13 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
 
        wprintf("<input type=\"radio\" name=\"rrend\" id=\"rrend_none\" "
                "%s onChange=\"RecurrenceShowHide();\">",
-               (1 ? "checked" : "")
+               ((which_rrend_is_preselected == 0) ? "checked" : "")
        );
        wprintf("%s</input><br />\n", _("No ending date"));
 
        wprintf("<input type=\"radio\" name=\"rrend\" id=\"rrend_count\" "
                "%s onChange=\"RecurrenceShowHide();\">",
-               (0 ? "checked" : "")
+               ((which_rrend_is_preselected == 1) ? "checked" : "")
        );
        wprintf(_("Repeat this event"));
        wprintf("</input> ");
@@ -517,7 +519,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
 
        wprintf("<input type=\"radio\" name=\"rrend\" id=\"rrend_until\" "
                "%s onChange=\"RecurrenceShowHide();\">",
-               (0 ? "checked" : "")
+               ((which_rrend_is_preselected == 2) ? "checked" : "")
        );
        wprintf(_("Repeat this event until "));
        wprintf("</input>");