diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-10-03 16:42:08 +0000 |
---|---|---|
committer | Tarmac <Unknown> | 2013-10-03 16:42:08 +0000 |
commit | 8b4e75ea9ce0a1f8c8be445dbde7de78a62b3caa (patch) | |
tree | eb56b4dea1c05f90f08b2e8fd404aabace14b22d | |
parent | ece762ee2e2fe52b4932e0c1dc6826fa06705c38 (diff) | |
parent | 5b22711fc71e6d0eb5dc8075cb7446b71b7549e1 (diff) | |
download | ayatana-indicator-datetime-8b4e75ea9ce0a1f8c8be445dbde7de78a62b3caa.tar.gz ayatana-indicator-datetime-8b4e75ea9ce0a1f8c8be445dbde7de78a62b3caa.tar.bz2 ayatana-indicator-datetime-8b4e75ea9ce0a1f8c8be445dbde7de78a62b3caa.zip |
Change the tablet time format string to remove leading zeroes from the hour component of the time format (ie, H:MM rather than HH:MM). Fixes: https://bugs.launchpad.net/bugs/1234483.
Approved by PS Jenkins bot, Ted Gould.
-rw-r--r-- | src/utils.c | 4 | ||||
-rw-r--r-- | tests/test-utils.cc | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/utils.c b/src/utils.c index 9b0f24f..bbb24ac 100644 --- a/src/utils.c +++ b/src/utils.c @@ -301,8 +301,8 @@ get_terse_time_format_string (GDateTime * time) if (g_date_time_get_minute (time) != 0) { - /* a strftime(3) fmt string for a HH:MM 12 hour time, eg "06:59 PM" */ - fmt = T_("%I:%M %p"); + /* a strftime(3) fmt string for a H:MM 12 hour time, eg "6:59 PM" */ + fmt = T_("%l:%M %p"); } else { diff --git a/tests/test-utils.cc b/tests/test-utils.cc index c757a11..d0f277b 100644 --- a/tests/test-utils.cc +++ b/tests/test-utils.cc @@ -78,12 +78,12 @@ TEST (UtilsTest, GenerateTerseFormatString) GDateTime * time; const char * expected_format_string; } test_cases[] = { - { g_date_time_ref(arbitrary_day), g_date_time_ref(arbitrary_day), "%I:%M %p" }, /* identical time */ - { g_date_time_ref(arbitrary_day), g_date_time_add_hours(arbitrary_day,1), "%I:%M %p" }, /* later today */ - { g_date_time_ref(arbitrary_day), g_date_time_add_days(arbitrary_day,1), "Tomorrow" EM_SPACE "%I:%M %p" }, /* tomorrow */ - { g_date_time_ref(arbitrary_day), g_date_time_add_days(arbitrary_day,2), "%a" EM_SPACE "%I:%M %p" }, - { g_date_time_ref(arbitrary_day), g_date_time_add_days(arbitrary_day,6), "%a" EM_SPACE "%I:%M %p" }, - { g_date_time_ref(arbitrary_day), g_date_time_add_days(arbitrary_day,7), "%d %b" EM_SPACE "%I:%M %p" }, /* over one week away */ + { g_date_time_ref(arbitrary_day), g_date_time_ref(arbitrary_day), "%l:%M %p" }, /* identical time */ + { g_date_time_ref(arbitrary_day), g_date_time_add_hours(arbitrary_day,1), "%l:%M %p" }, /* later today */ + { g_date_time_ref(arbitrary_day), g_date_time_add_days(arbitrary_day,1), "Tomorrow" EM_SPACE "%l:%M %p" }, /* tomorrow */ + { g_date_time_ref(arbitrary_day), g_date_time_add_days(arbitrary_day,2), "%a" EM_SPACE "%l:%M %p" }, + { g_date_time_ref(arbitrary_day), g_date_time_add_days(arbitrary_day,6), "%a" EM_SPACE "%l:%M %p" }, + { g_date_time_ref(arbitrary_day), g_date_time_add_days(arbitrary_day,7), "%d %b" EM_SPACE "%l:%M %p" }, /* over one week away */ { g_date_time_ref(on_the_hour), g_date_time_ref(on_the_hour), "%l %p" }, /* identical time */ { g_date_time_ref(on_the_hour), g_date_time_add_hours(on_the_hour,1), "%l %p" }, /* later today */ |