gnome-panel r10988 - trunk/applets/clock



Author: vuntz
Date: Mon Apr  7 13:29:29 2008
New Revision: 10988
URL: http://svn.gnome.org/viewvc/gnome-panel?rev=10988&view=rev

Log:
2008-04-07  Vincent Untz  <vuntz gnome org>

	* calendar-window.c: (calendar_day_activated): open evo on the right
	day, instead of some day before or after because of timezone
	confusion.
	Fix bug #372155


Modified:
   trunk/applets/clock/ChangeLog
   trunk/applets/clock/calendar-window.c

Modified: trunk/applets/clock/calendar-window.c
==============================================================================
--- trunk/applets/clock/calendar-window.c	(original)
+++ trunk/applets/clock/calendar-window.c	Mon Apr  7 13:29:29 2008
@@ -1158,12 +1158,25 @@
 	unsigned int  day;
 	unsigned int  month;
 	unsigned int  year;
+	time_t        now;
+	struct tm     utc_tm;
+	struct tm     local_tm;
 	char         *argument;
 
 	gtk_calendar_get_date (calendar, &year, &month, &day);
 
-	argument = g_strdup_printf ("calendar:///?startdate=%.4d%.2d%.2d",
-				    year, month + 1, day);
+	time (&now);
+	gmtime_r (&now, &utc_tm);
+	localtime_r (&now, &local_tm);
+
+	/* FIXME: once bug 409200 is fixed, we'll have to make this hh:mm:ss
+	 * instead of hhmmss */
+	argument = g_strdup_printf ("calendar:///?startdate="
+				    "%.4d%.2d%.2dT%.2d%.2d%.2dZ",
+				    year, month + 1, day,
+				    12 + utc_tm.tm_hour - local_tm.tm_hour,
+				    0  + utc_tm.tm_min  - local_tm.tm_min,
+				    0);
 
 	clock_launch_evolution (calwin, argument);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]