diff --git a/src/gcal-utils.c b/src/gcal-utils.c index 5e2137be..33aeab74 100644 --- a/src/gcal-utils.c +++ b/src/gcal-utils.c @@ -349,6 +349,17 @@ get_desc_from_component (ECalComponent *component, return desc; } +gint +get_first_weekday (void) +{ + const char *const s = nl_langinfo(_NL_TIME_FIRST_WEEKDAY); + + if (s && *s >= 1 && *s <= 7) + return ((int)*s) - 1; + + return 0; +} + /* Function to do a last minute fixup of the AM/PM stuff if the locale * and gettext haven't done it right. Most English speaking countries * except the USA use the 24 hour clock (UK, Australia etc). However diff --git a/src/gcal-utils.h b/src/gcal-utils.h index 11e0381e..ac1bab7a 100644 --- a/src/gcal-utils.h +++ b/src/gcal-utils.h @@ -81,6 +81,8 @@ void print_date (const gchar* gchar* get_desc_from_component (ECalComponent *component, const gchar *joint_char); +gint get_first_weekday (void); + /* code brought from evolution */ gsize e_strftime_fix_am_pm (gchar *str, gsize max,