From ea92c0561f243fb193457de7e2b0eb03d8f7fd06 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 2 Sep 2014 23:52:27 -0500 Subject: remove the seconds from the alarms' snap decisions. --- src/snap.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/snap.cpp') 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 +#include // is_locale_12h() #include #include @@ -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(minutes)); -- cgit v1.2.3