aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gncal-week-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gncal-week-view.c')
-rw-r--r--calendar/gncal-week-view.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/calendar/gncal-week-view.c b/calendar/gncal-week-view.c
index fcfe34aec3..888c656ff4 100644
--- a/calendar/gncal-week-view.c
+++ b/calendar/gncal-week-view.c
@@ -224,19 +224,18 @@ gncal_week_view_set (GncalWeekView *wview, time_t start_of_week)
/* The label */
{
- char buf [80];
- int len;
- struct tm *t;
+ char buf [3][100];
week_end = time_add_day (week_start, 6);
- t = localtime (&week_start);
-
- strftime (buf, sizeof (buf), _("%a %b %d %Y - "), t);
- len = strlen (buf);
- t = localtime (&week_end);
- strftime (buf + len, sizeof (buf) - len, _("%a %b %d %Y"), t);
- gtk_label_set (GTK_LABEL (wview->label), buf);
+ strftime (buf[0], sizeof (buf[0]), _("%a %b %d %Y"),
+ localtime(&week_start));
+
+ strftime (buf[1], sizeof (buf[1]), _("%a %b %d %Y"),
+ localtime(&week_end));
+
+ g_snprintf(buf[2], sizeof(buf[2]), "%s - %s", buf[0], buf[1]);
+ gtk_label_set (GTK_LABEL (wview->label), buf[2]);
}
}