[geary: 3/8] util-date: extract getting format string to a function helper
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary: 3/8] util-date: extract getting format string to a function helper
- Date: Sat, 23 Mar 2019 03:28:11 +0000 (UTC)
commit beb25cc622b7c31921859abc4c6ba0e9f9ab500e
Author: Konstantin Kharlamov <Hi-Angel yandex ru>
Date: Fri Mar 1 00:47:47 2019 +0300
util-date: extract getting format string to a function helper
It's public because it will be used in next commit
Signed-off-by: Konstantin Kharlamov <Hi-Angel yandex ru>
src/client/util/util-date.vala | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/client/util/util-date.vala b/src/client/util/util-date.vala
index 8f83c684..16fab9b3 100644
--- a/src/client/util/util-date.vala
+++ b/src/client/util/util-date.vala
@@ -171,7 +171,7 @@ private string pretty_print_coarse(CoarseDate coarse_date, ClockFormat clock_for
return ngettext("%dh ago", "%dh ago", (ulong) rounded).printf(rounded);
case CoarseDate.TODAY:
- fmt = xlat_pretty_clocks[clock_format.to_index()];
+ fmt = get_clock_format(clock_format);
break;
case CoarseDate.YESTERDAY:
@@ -209,4 +209,8 @@ public string pretty_print_verbose(DateTime datetime, ClockFormat clock_format)
return datetime.format(xlat_pretty_verbose_dates[clock_format.to_index()]);
}
+public string get_clock_format(ClockFormat clock_format) {
+ return xlat_pretty_clocks[clock_format.to_index()];
+}
+
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]