From def47bd92c61d317b33df6efca56a33c2db0e865 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 23 Sep 2008 15:41:58 +0000 Subject: [PATCH] Added weekday selection checkboxes to the recurrence editor --- webcit/event.c | 66 +++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 57 insertions(+), 9 deletions(-) diff --git a/webcit/event.c b/webcit/event.c index dec7ed982..51c59c087 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -8,6 +8,20 @@ #include "webserver.h" + + + struct tm tm; + time_t thetime; + int i; + + + + + + + + + /* * Display an event by itself (for editing) * supplied_vevent the event to edit @@ -29,11 +43,26 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, int organizer_is_me = 0; int i, j = 0; int sequence = 0; + char weekday_labels[7][32]; lprintf(9, "display_edit_individual_event(%ld) calview=%s year=%s month=%s day=%s\n", msgnum, bstr("calview"), bstr("year"), bstr("month"), bstr("day") ); + /* populate the weekday names - begin */ + now = time(NULL); + localtime_r(&now, &tm_now); + while (tm_now.tm_wday != 0) { + now -= 86400L; + localtime_r(&now, &tm_now); + } + for (i=0; i<7; ++i) { + localtime_r(&now, &tm_now); + wc_strftime(weekday_labels[i], 32, "%A", &tm_now); + now += 86400L; + } + /* populate the weekday names - end */ + now = time(NULL); strcpy(organizer_string, ""); strcpy(attendee_string, ""); @@ -435,30 +464,49 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, wprintf("