aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-10-03 16:16:24 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-10-03 16:16:24 -0500
commitd9deaaaeb8c09db33539b498effe88b549d15b0f (patch)
tree29f151cc339fbef7f0b89491a07875bf58cda6c1
parent8b4e75ea9ce0a1f8c8be445dbde7de78a62b3caa (diff)
downloadayatana-indicator-datetime-d9deaaaeb8c09db33539b498effe88b549d15b0f.tar.gz
ayatana-indicator-datetime-d9deaaaeb8c09db33539b498effe88b549d15b0f.tar.bz2
ayatana-indicator-datetime-d9deaaaeb8c09db33539b498effe88b549d15b0f.zip
phone: show appointments at 1AM as '1 AM', clock times as '1:00 AM'
-rw-r--r--src/service.c2
-rw-r--r--src/utils.c10
-rw-r--r--src/utils.h2
3 files changed, 11 insertions, 3 deletions
diff --git a/src/service.c b/src/service.c
index 2528f41..ee00723 100644
--- a/src/service.c
+++ b/src/service.c
@@ -498,7 +498,7 @@ create_phone_header_state (IndicatorDatetimeService * self)
/* label */
now = indicator_datetime_service_get_localtime (self);
- fmt = get_terse_time_format_string (now);
+ fmt = get_terse_header_time_format_string ();
label = g_date_time_format (now, fmt);
/* icon */
diff --git a/src/utils.c b/src/utils.c
index bbb24ac..60fd393 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -294,6 +294,13 @@ get_terse_date_format_string (date_proximity_t proximity)
return fmt;
}
+const gchar*
+get_terse_header_time_format_string (void)
+{
+ /* a strftime(3) fmt string for a H:MM 12 hour time, eg "6:59 PM" */
+ return T_("%l:%M %p");
+}
+
const gchar *
get_terse_time_format_string (GDateTime * time)
{
@@ -301,8 +308,7 @@ get_terse_time_format_string (GDateTime * time)
if (g_date_time_get_minute (time) != 0)
{
- /* a strftime(3) fmt string for a H:MM 12 hour time, eg "6:59 PM" */
- fmt = T_("%l:%M %p");
+ fmt = get_terse_header_time_format_string ();
}
else
{
diff --git a/src/utils.h b/src/utils.h
index 31a12bc..24eddb6 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -45,6 +45,8 @@ gchar* join_date_and_time_format_strings (const char * date_fmt,
const gchar * get_terse_time_format_string (GDateTime * time);
+const gchar * get_terse_header_time_format_string (void);
+
const gchar * get_full_time_format_string (GSettings * settings);
gchar * generate_terse_format_string_at_time (GDateTime * now,