Author: juha
Date: 2007-03-15 22:05:46 +0000 (Thu, 15 Mar 2007)
New Revision: 25173

Modified:
   xfcalendar/branches/xfce_4_4/src/appointment.c
   xfcalendar/branches/xfce_4_4/src/ical-code.c
Log:
Fix for Bug 2937:
recurring events need to happen on ending date also.
This is now full and final fix for the issue. Previous
patch did not correct all situations.


Modified: xfcalendar/branches/xfce_4_4/src/appointment.c
===================================================================
--- xfcalendar/branches/xfce_4_4/src/appointment.c      2007-03-15 21:15:32 UTC 
(rev 25172)
+++ xfcalendar/branches/xfce_4_4/src/appointment.c      2007-03-15 22:05:46 UTC 
(rev 25173)
@@ -629,7 +629,7 @@
                 GTK_BUTTON(apptw->appRecur_until_button)));
         g_sprintf(appt->recur_until, XFICAL_APPT_TIME_FORMAT
                 , current_t.tm_year + 1900, current_t.tm_mon + 1
-                , current_t.tm_mday, 23, 59, 59);
+                , current_t.tm_mday, 23, 59, 10);
     }
     else
         g_warning("fill_appt_from_apptw: coding error, illegal recurrence");

Modified: xfcalendar/branches/xfce_4_4/src/ical-code.c
===================================================================
--- xfcalendar/branches/xfce_4_4/src/ical-code.c        2007-03-15 21:15:32 UTC 
(rev 25172)
+++ xfcalendar/branches/xfce_4_4/src/ical-code.c        2007-03-15 22:05:46 UTC 
(rev 25173)
@@ -1254,6 +1254,8 @@
     struct icaldurationtype duration;
     int i, cnt;
     gchar *byday_a[] = {"MO", "TU", "WE", "TH", "FR", "SA", "SU"};
+    icaltimezone *l_icaltimezone = NULL;
+    const char *text;
 
     dtstamp = icaltime_current_time_with_zone(utc_icaltimezone);
     if (add) {
@@ -1378,7 +1380,26 @@
             recur_p += g_sprintf(recur_p, ";COUNT=%d", appt->recur_count);
         }
         else if (appt->recur_limit == 2) { /* needs to be in UTC */
-            recur_p += g_sprintf(recur_p, ";UNTIL=%sZ", appt->recur_until);
+/* BUG 2937: convert recur_until to utc from start time timezone */
+            wtime = icaltime_from_string(appt->recur_until);
+            if XFICAL_STR_EXISTS(appt->start_tz_loc) {
+            /* Null == floating => no special action needed */
+                if (strcmp(appt->start_tz_loc, "floating") == 0) {
+                    wtime = icaltime_convert_to_zone(wtime
+                            , local_icaltimezone);
+                }
+                else if (strcmp(appt->start_tz_loc, "UTC") != 0) {
+                /* FIXME: add this vtimezone to vcalendar if it is not there */
+                    l_icaltimezone = icaltimezone_get_builtin_timezone(
+                            appt->start_tz_loc);
+                    wtime = icaltime_convert_to_zone(wtime, l_icaltimezone);
+                }
+            }
+            else
+                wtime = icaltime_convert_to_zone(wtime, local_icaltimezone);
+            wtime = icaltime_convert_to_zone(wtime, utc_icaltimezone);
+            text  = icaltime_as_ical_string(wtime);
+            recur_p += g_sprintf(recur_p, ";UNTIL=%s", text);
         }
         recur_p2 = recur_p; /* store current pointer */
         for (i = 0, cnt = 0; i <= 6; i++) {

_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to