From: Art Cancro Date: Tue, 21 Oct 2008 21:41:13 +0000 (+0000) Subject: more work on the recurrence editor X-Git-Tag: v7.86~1837 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=5781ffcd1cafce9a8f8e1100bea65495a5c593d3;hp=595d9fbc92dc7af5604ce03b2ff858d882ca0f05;p=citadel.git more work on the recurrence editor --- diff --git a/webcit/event.c b/webcit/event.c index 2d942aba4..82da8f453 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -530,9 +530,16 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, ); int rrmday = t_start.day; - int rrmweek = 1; /* FIXME default to same as event start */ int rrmweekday = icaltime_day_of_week(t_start) - 1; + /* Figure out what week of the month we're in */ + icaltimetype day1 = t_start; + day1.day = 1; + int weekbase = icaltime_week_number(day1); + int rrmweek = icaltime_week_number(t_start) - weekbase + 1; + + /* Are we going by day of the month or week/day? */ + if (recur.by_month_day[0] != ICAL_RECURRENCE_ARRAY_MAX) { which_rrmonthtype_is_preselected = 0; rrmday = recur.by_month_day[0]; @@ -581,9 +588,11 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, wprintf("\n"); /* end 'monthday_selector' div */ - int rrymweek = 1; /* FIXME default to same as event start */ - int rrymweekday = 1; /* FIXME default to same as event start */ - int rrymonth = 1; /* FIXME default to same as event start */ + int rrymweek = rrmweek; + int rrymweekday = rrmweekday; + int rrymonth = t_start.month; + + lprintf(9, "FIXME: RRYMWEEK %d, RRYMWEEKDAY %d, RRYMONTH %d\n", rrymweek, rrymweekday, rrymonth); int which_rryeartype_is_preselected = 0;