utils: retrieve first_weekday from locale

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=703317
This commit is contained in:
Erick Pérez Castellanos
2014-12-04 17:10:50 -05:00
parent 8531fedde9
commit ff73499ab0
2 changed files with 13 additions and 0 deletions
+11
View File
@@ -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
+2
View File
@@ -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,