aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog7
-rw-r--r--calendar/gui/weekday-picker.c17
2 files changed, 12 insertions, 12 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index d6ba17a3ef..db0a0582e9 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,10 @@
+2007-12-03 Matthew Barnes <mbarnes@redhat.com>
+
+ ** Fixes part of bug #392747
+
+ * gui/weekday-picker.c (get_day_text):
+ Convert the day_index to GDateWeekday and call e_get_weekday_name().
+
2007-11-30 Milan Crha <mcrha@redhat.com>
** Fix for bug #325730
diff --git a/calendar/gui/weekday-picker.c b/calendar/gui/weekday-picker.c
index 166c5d5b26..709255f374 100644
--- a/calendar/gui/weekday-picker.c
+++ b/calendar/gui/weekday-picker.c
@@ -28,6 +28,7 @@
#include <glib/gi18n.h>
#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
#include <libgnomecanvas/gnome-canvas-text.h>
+#include <e-util/e-util.h>
#include "weekday-picker.h"
@@ -315,20 +316,12 @@ colorize_items (WeekdayPicker *wp)
static char *
get_day_text (int day_index)
{
- /* The first letter of each day of the week starting with Sunday */
- const char *str = _("SMTWTFS");
- char *day;
- int char_size = 0;
+ GDateWeekday weekday;
- day = g_utf8_offset_to_pointer (str, day_index);
+ /* Convert from tm_wday to GDateWeekday. */
+ weekday = (day_index == 0) ? G_DATE_SUNDAY : day_index;
- /* we use strlen because we actually want to count bytes */
- if (day_index == 6)
- char_size = strlen (day);
- else
- char_size = strlen (day) - strlen (g_utf8_find_next_char (day, NULL));
-
- return g_strndup (day, char_size);
+ return g_strdup (e_get_weekday_name (weekday, TRUE));
}
static void