aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-09-05 14:12:28 +0000
committerCI bot <ps-jenkins@lists.canonical.com>2014-09-05 14:12:28 +0000
commit94f9ecf2277ca30f3205effe5905441bd6fabcdf (patch)
tree0b861a82badd95bb210bfaece3e3d7744ce9585f
parent7affbfb591fe0d5b68bdf5023eae2aba5e727dd2 (diff)
parentea92c0561f243fb193457de7e2b0eb03d8f7fd06 (diff)
downloadayatana-indicator-datetime-94f9ecf2277ca30f3205effe5905441bd6fabcdf.tar.gz
ayatana-indicator-datetime-94f9ecf2277ca30f3205effe5905441bd6fabcdf.tar.bz2
ayatana-indicator-datetime-94f9ecf2277ca30f3205effe5905441bd6fabcdf.zip
In the alarm's popup notifications' titlebars, don't show the seconds in the time format string. Fixes: 1364374
Approved by: Pete Woods, PS Jenkins bot
-rw-r--r--src/snap.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/snap.cpp b/src/snap.cpp
index 505980c..b3368a1 100644
--- a/src/snap.cpp
+++ b/src/snap.cpp
@@ -18,6 +18,7 @@
*/
#include <datetime/snap.h>
+#include <datetime/utils.h> // is_locale_12h()
#include <notifications/awake.h>
#include <notifications/haptic.h>
@@ -92,8 +93,10 @@ public:
b.add_hint (uin::Builder::HINT_SNAP);
b.add_hint (uin::Builder::HINT_TINT);
b.add_hint (uin::Builder::HINT_NONSHAPEDICON);
- const auto timestr = appointment.begin.format (_("%a, %X"));
- auto title = g_strdup_printf (_("Alarm %s"), timestr.c_str());
+
+ const auto timefmt = is_locale_12h() ? _("%a, %l:%M %p") : _("%a, %H:%M");
+ const auto timestr = appointment.begin.format(timefmt);
+ auto title = g_strdup_printf(_("Alarm %s"), timestr.c_str());
b.set_title (title);
g_free (title);
b.set_timeout (std::chrono::duration_cast<std::chrono::seconds>(minutes));