aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-09-02 23:52:27 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-09-02 23:52:27 -0500
commitea92c0561f243fb193457de7e2b0eb03d8f7fd06 (patch)
tree36a02a09651fe98272f347d2e982befa0de32665
parent31cb88dcdffee6c66e00ab6247f4d0c7b088cf28 (diff)
downloadayatana-indicator-datetime-ea92c0561f243fb193457de7e2b0eb03d8f7fd06.tar.gz
ayatana-indicator-datetime-ea92c0561f243fb193457de7e2b0eb03d8f7fd06.tar.bz2
ayatana-indicator-datetime-ea92c0561f243fb193457de7e2b0eb03d8f7fd06.zip
remove the seconds from the alarms' snap decisions.
-rw-r--r--src/snap.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/snap.cpp b/src/snap.cpp
index 0b2322a..dd629a8 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));