From ac1f89610734b422aeaa627d7cb1f5825b4116ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 10 Sep 2019 05:10:01 +0200 Subject: [PATCH] environment: Reimplement Date.toLocaleFormat() override Now that we no longer go through GTimeVal to convert from Date to GDateTime, there is no more reason for using a C helper function. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/807 --- js/ui/environment.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/ui/environment.js b/js/ui/environment.js index 4b330e5da..715aca31d 100644 --- a/js/ui/environment.js +++ b/js/ui/environment.js @@ -292,7 +292,8 @@ function init() { // Work around https://bugzilla.mozilla.org/show_bug.cgi?id=508783 Date.prototype.toLocaleFormat = function(format) { - return Shell.util_format_date(format, this.getTime()); + let dt = GLib.DateTime.new_from_unix_local(this.getTime() / 1000); + return dt ? dt.format(format) : ''; }; let slowdownEnv = GLib.getenv('GNOME_SHELL_SLOWDOWN_FACTOR');