[gnome-shell] dateMenu: Use formatTime() for world clock
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] dateMenu: Use formatTime() for world clock
- Date: Wed, 4 Mar 2015 12:55:49 +0000 (UTC)
commit 39fd7b9a05a75dabd19628ab1ac4afe007404bb5
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Feb 25 20:26:08 2015 +0100
dateMenu: Use formatTime() for world clock
https://bugzilla.gnome.org/show_bug.cgi?id=745111
js/ui/dateMenu.js | 14 +-------------
1 files changed, 1 insertions(+), 13 deletions(-)
---
diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js
index 76d66fc..cd77c41 100644
--- a/js/ui/dateMenu.js
+++ b/js/ui/dateMenu.js
@@ -200,23 +200,11 @@ const WorldClocksSection = new Lang.Class({
},
_updateLabels: function() {
- let desktopSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.interface' });
- let clockFormat = desktopSettings.get_string('clock-format');
- let hasAmPm = new Date().toLocaleFormat('%p') != '';
-
- let format;
- if (clockFormat == '24h' || !hasAmPm)
- /* Translators: Time in 24h format */
- format = N_("%H\u2236%M");
- else
- /* Translators: Time in 12h format */
- format = N_("%l\u2236%M %p");
-
for (let i = 0; i < this._locations.length; i++) {
let l = this._locations[i];
let tz = GLib.TimeZone.new(l.location.get_timezone().get_tzid());
let now = GLib.DateTime.new_now(tz);
- l.actor.text = now.format(format);
+ l.actor.text = Util.formatTime(now, { timeOnly: true });
}
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]