From 69e448bc28e56ea861088111a937bcce34d83c00 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Mon, 3 Apr 2017 08:30:25 -0700 Subject: [PATCH] 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 file changed, 3 insertions(+) diff --git a/glib/gdatetime.c b/glib/gdatetime.c index 5211c144e..11e10e570 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) {