From 659d4ec96951df5db4a9b589765f574c33ed8618 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 21 Aug 2008 02:02:46 +0000 Subject: [PATCH] Started developing the recurrence editor --- webcit/calendar.c | 2 -- webcit/calendar_view.c | 2 -- webcit/event.c | 30 +++++++++++++++++++++++++++++- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/webcit/calendar.c b/webcit/calendar.c index fb3f19e89..f0ec31460 100644 --- a/webcit/calendar.c +++ b/webcit/calendar.c @@ -494,8 +494,6 @@ void display_individual_cal(icalcomponent *cal, long msgnum, char *from, int unr ritr = icalrecur_iterator_new(recur, dtstart); if (!ritr) return; - lprintf(9, "Recurrence found: %s\n", icalrecurrencetype_as_string(&recur)); - while (next = icalrecur_iterator_next(ritr), !icaltime_is_null_time(next) ) { ++num_recur; diff --git a/webcit/calendar_view.c b/webcit/calendar_view.c index f5f440baf..d964f901e 100644 --- a/webcit/calendar_view.c +++ b/webcit/calendar_view.c @@ -511,9 +511,7 @@ void calendar_month_view(int year, int month, int day) { localtime_r(&thetime, &tm); while (tm.tm_wday != weekstart) { thetime = thetime - (time_t)86400; /* go back 24 hours */ - lprintf(9, "Subtracting a day, thetime is now %d - %s", thetime, ctime(&thetime)); localtime_r(&thetime, &tm); - lprintf(9, "tm.tm_wday is %d, weekstart is %d\n", tm.tm_wday, weekstart); } /* Outer table (to get the background color) */ diff --git a/webcit/event.c b/webcit/event.c index cb6b75dda..ba4b8ce67 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -383,7 +383,35 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, rrule = icalcomponent_get_first_property(vevent, ICAL_RRULE_PROPERTY); if (rrule) { recur = icalproperty_get_rrule(rrule); - wprintf("%s
\n", icalrecurrencetype_as_string(&recur)); + + wprintf("\n"); /* same table style as the event tab */ + + /* Table row displaying raw RRULE data, FIXME remove when finished */ + wprintf("\n"); + + char *frequency_units[] = { + _("seconds"), + _("minutes"), + _("hours"), + _("days"), + _("weeks"), + _("months"), + _("years"), + _("never") + }; + + wprintf("\n"); + + wprintf("
"); + wprintf("Raw data"); + wprintf(""); + wprintf("%s", icalrecurrencetype_as_string(&recur)); + wprintf("
"); + wprintf(_("Repeats")); + wprintf(""); + if ((recur.freq < 0) || (recur.freq > 6)) recur.freq = 4; + wprintf("every %d %s", recur.interval, frequency_units[recur.freq]); + wprintf("
\n"); } end_tab(2, 3); -- 2.30.2