[glib] datetime: add fallback logic for AM/PM specifier



commit 69e448bc28e56ea861088111a937bcce34d83c00
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Apr 3 08:30:25 2017 -0700

    datetime: add fallback logic for AM/PM specifier
    
    When the locale does not provide any string for AM/PM, fallback to the
    default.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=761889

 glib/gdatetime.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/glib/gdatetime.c b/glib/gdatetime.c
index 5211c14..11e10e5 100644
--- a/glib/gdatetime.c
+++ b/glib/gdatetime.c
@@ -2216,6 +2216,9 @@ format_ampm (GDateTime *datetime,
 
   ampm = GET_AMPM (datetime);
 
+  if (!ampm || ampm[0] == '\0')
+    ampm = get_fallback_ampm (g_date_time_get_hour (datetime));
+
 #if defined (HAVE_LANGINFO_TIME)
   if (!locale_is_utf8)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]