Blob Blame History Raw
diff -up evolution-3.12.11/calendar/gui/e-cal-component-preview.c.calendar-task-datetime-fmt evolution-3.12.11/calendar/gui/e-cal-component-preview.c
--- evolution-3.12.11/calendar/gui/e-cal-component-preview.c.calendar-task-datetime-fmt	2014-07-07 12:56:09.000000000 +0200
+++ evolution-3.12.11/calendar/gui/e-cal-component-preview.c	2016-03-17 09:50:06.870894068 +0100
@@ -159,13 +159,11 @@ update_comp_info (ECalComponentPreview *
 static gchar *
 timet_to_str_with_zone (ECalComponentDateTime *dt,
                         ECalClient *client,
-                        icaltimezone *default_zone,
-                        gboolean use_24_hour_format)
+                        icaltimezone *default_zone)
 {
 	struct icaltimetype itt;
 	icaltimezone *zone = NULL;
 	struct tm tm;
-	gchar buf[256];
 
 	if (dt->tzid != NULL) {
 		e_cal_client_get_timezone_sync (
@@ -179,11 +177,7 @@ timet_to_str_with_zone (ECalComponentDat
 		icaltimezone_convert_time (&itt, zone, default_zone);
 	tm = icaltimetype_to_tm (&itt);
 
-	e_time_format_date_and_time (
-		&tm, use_24_hour_format,
-		FALSE, FALSE, buf, sizeof (buf));
-
-	return g_locale_to_utf8 (buf, -1, NULL, NULL, NULL);
+	return e_datetime_format_format_tm ("calendar", "table", itt.is_date ? DTFormatKindDate : DTFormatKindDateTime, &tm);
 }
 
 static void
@@ -193,7 +187,6 @@ cal_component_preview_write_html (ECalCo
 	ECalClient *client;
 	ECalComponent *comp;
 	icaltimezone *default_zone;
-	gboolean use_24_hour_format;
 	ECalComponentText text;
 	ECalComponentDateTime dt;
 	gchar *str;
@@ -208,7 +201,6 @@ cal_component_preview_write_html (ECalCo
 	client = preview->priv->client;
 	comp = preview->priv->comp;
 	default_zone = preview->priv->timezone;
-	use_24_hour_format = preview->priv->use_24_hour_format;
 
 	/* write document header */
 	e_cal_component_get_summary (comp, &text);
@@ -264,8 +256,7 @@ cal_component_preview_write_html (ECalCo
 	/* write start date */
 	e_cal_component_get_dtstart (comp, &dt);
 	if (dt.value != NULL) {
-		str = timet_to_str_with_zone (
-			&dt, client, default_zone, use_24_hour_format);
+		str = timet_to_str_with_zone (&dt, client, default_zone);
 		g_string_append_printf (
 			buffer, "<tr><th>%s</th><td>%s</td></tr>",
 			_("Start Date:"), str);
@@ -276,8 +267,7 @@ cal_component_preview_write_html (ECalCo
 	/* write end date */
 	e_cal_component_get_dtend (comp, &dt);
 	if (dt.value != NULL) {
-		str = timet_to_str_with_zone (
-			&dt, client, default_zone, use_24_hour_format);
+		str = timet_to_str_with_zone (&dt, client, default_zone);
 		g_string_append_printf (
 			buffer,"<tr><th>%s</th><td>%s</td></tr>",
 			_("End Date:"), str);
@@ -288,8 +278,7 @@ cal_component_preview_write_html (ECalCo
 	/* write Due Date */
 	e_cal_component_get_due (comp, &dt);
 	if (dt.value != NULL) {
-		str = timet_to_str_with_zone (
-			&dt, client, default_zone, use_24_hour_format);
+		str = timet_to_str_with_zone (&dt, client, default_zone);
 		g_string_append_printf (
 			buffer, "<tr><th>%s</th><td>%s</td></tr>",
 			_("Due Date:"), str);