[gnome-shell] environment: Reimplement Date.toLocaleFormat() override



commit ac1f89610734b422aeaa627d7cb1f5825b4116ee
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Sep 10 05:10:01 2019 +0200

    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 4b330e5da5..715aca31d2 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');


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]