Open
Conversation
Date.prototype.toLocaleFormat is no longer available in gjs. Code from https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/master/js/ui/environment.js
I noticed that a warning & error were shown from `journalctl -f -o cat /usr/bin/gnome-shell`: ``` Some code accessed the property 'Class' on the module 'Settings'. That property was defined with 'let' or 'const' inside the module. This was previously supported, but is not correct according to the ES6 standard. Any symbols to be exported from a module must be defined with 'var'. The property access will work as previously for the time being, but please fix your code anyway. JS ERROR: Extension datetime-format@Daniel-Khodabakhsh.github.com: TypeError: extension.imports.Settings.Class is not a constructor @/home/brendan/.local/share/gnome-shell/extensions/datetime-format@Daniel-Khodabakhsh.github.com/extension.js:10:18 _callExtensionInit@resource:///org/gnome/shell/ui/extensionSystem.js:435:13 loadExtension@resource:///org/gnome/shell/ui/extensionSystem.js:360:27 _loadExtensions/<@resource:///org/gnome/shell/ui/extensionSystem.js:611:18 collectFromDatadirs@resource:///org/gnome/shell/misc/fileUtils.js:27:28 _loadExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:590:19 _enableAllExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:617:18 _sessionUpdated@resource:///org/gnome/shell/ui/extensionSystem.js:637:14 init@resource:///org/gnome/shell/ui/extensionSystem.js:55:14 _initializeUI@resource:///org/gnome/shell/ui/main.js:288:22 start@resource:///org/gnome/shell/ui/main.js:165:5 @resource:///org/gnome/shell/ui/init.js:6:17 ```
Warning: ``` Some code accessed the property 'defaultFormat' on the module 'DateMenuDate'. That property was defined with 'let' or 'const' inside the module. This was previously supported, but is not correct according to the ES6 standard. Any symbols to be exported from a module must be defined with 'var'. The property access will work as previously for the time being, but please fix your code anyway. ```
``` JS ERROR: TypeError: Object is of type Gtk.Box - cannot convert to GtkWindow Class/this.showWindow@/home/brendan/.local/share/gnome-shell/extensions/datetime-format@Daniel-Khodabakhsh.github.com/EditWindow.js:111:10 create/<@/home/brendan/.local/share/gnome-shell/extensions/datetime-format@Daniel-Khodabakhsh.github.com/FormatTarget.js:59:14 run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:186:20 main@resource:///org/gnome/Shell/Extensions/js/main.js:21:13 run@resource:///org/gnome/gjs/modules/script/package.js:206:19 start@resource:///org/gnome/gjs/modules/script/package.js:190:8 @/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17 Caused by: Error: This JS object wrapper isn't wrapping a GObject. If this is a custom subclass, are you sure you chained up to the parent _init properly? ```
``` JS WARNING: [/home/brendan/.local/share/gnome-shell/extensions/datetime-format@Daniel-Khodabakhsh.github.com/FormatTarget.js 62]: Too many arguments to method Gtk.Box.append: expected 1, got 4 ```
``` Some code accessed the property 'name' on the module 'DateMenuDate'. That property was defined with 'let' or 'const' inside the module. This was previously supported, but is not correct according to the ES6 standard. Any symbols to be exported from a module must be defined with 'var'. The property access will work as previously for the time being, but please fix your code anyway. Some code accessed the property 'name' on the module 'DateMenuDay'. That property was defined with 'let' or 'const' inside the module. This was previously supported, but is not correct according to the ES6 standard. Any symbols to be exported from a module must be defined with 'var'. The property access will work as previously for the time being, but please fix your code anyway. Some code accessed the property 'name' on the module 'StatusBar'. That property was defined with 'let' or 'const' inside the module. This was previously supported, but is not correct according to the ES6 standard. Any symbols to be exported from a module must be defined with 'var'. The property access will work as previously for the time being, but please fix your code anyway. ```
``` Some code called array.toString() on a Uint8Array instance. Previously this would have interpreted the bytes of the array as a string, but that is nonstandard. In the future this will return the bytes as comma-separated digits. For the time being, the old behavior has been preserved, but please fix your code anyway to explicitly call ByteArray.toString(array). (Note that array.toString() may have been called implicitly.) 0 readFile() ["/home/brendan/.local/share/gnome-shell/extensions/datetime-format@Daniel-Khodabakhsh.github.com/prefs.js":86:8] 1 buildPrefsWidget() ["/home/brendan/.local/share/gnome-shell/extensions/datetime-format@Daniel-Khodabakhsh.github.com/prefs.js":102:27] 2 _init() ["resource:///org/gnome/Shell/Extensions/js/extensionPrefsDialog.js":32:43] 3 ExtensionPrefsDialog() ["resource:///org/gnome/Shell/Extensions/js/extensionPrefsDialog.js":10:3] 4 OpenExtensionPrefsAsync/<() ["resource:///org/gnome/Shell/Extensions/js/extensionsService.js":129:32] 5 asyncCallback() ["resource:///org/gnome/gjs/modules/core/overrides/Gio.js":115:21] 6 run() ["resource:///org/gnome/Shell/Extensions/js/dbusService.js":186:19] 7 main() ["resource:///org/gnome/Shell/Extensions/js/main.js":21:12] 8 run() ["resource:///org/gnome/gjs/modules/script/package.js":206:18] 9 start() ["resource:///org/gnome/gjs/modules/script/package.js":190:7] 10 <TOP LEVEL> ["/usr/share/gnome-shell/org.gnome.Shell.Extensions":1:16] ``` https://github.com/GNOME/gjs/blob/master/doc/ByteArray.md
``` Some code accessed the property 'create' on the module 'FormatTarget'. That property was defined with 'let' or 'const' inside the module. This was previously supported, but is not correct according to the ES6 standard. Any symbols to be exported from a module must be defined with 'var'. The property access will work as previously for the time being, but please fix your code anyway. JS ERROR: Failed to open preferences: TypeError: extension.imports.FormatTarget.create is not a function buildPrefsWidget/<@/home/brendan/.local/share/gnome-shell/extensions/datetime-format@Daniel-Khodabakhsh.github.com/prefs.js:142:107 buildPrefsWidget@/home/brendan/.local/share/gnome-shell/extensions/datetime-format@Daniel-Khodabakhsh.github.com/prefs.js:142:50 _init@resource:///org/gnome/Shell/Extensions/js/extensionPrefsDialog.js:32:44 ExtensionPrefsDialog@resource:///org/gnome/Shell/Extensions/js/extensionPrefsDialog.js:10:4 OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:129:33 asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:115:22 run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:186:20 main@resource:///org/gnome/Shell/Extensions/js/main.js:21:13 run@resource:///org/gnome/gjs/modules/script/package.js:206:19 start@resource:///org/gnome/gjs/modules/script/package.js:190:8 @/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17 JS ERROR: TypeError: prefsWindow is null buildPrefsWidget/<@/home/brendan/.local/share/gnome-shell/extensions/datetime-format@Daniel-Khodabakhsh.github.com/prefs.js:109:3 run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:186:20 main@resource:///org/gnome/Shell/Extensions/js/main.js:21:13 run@resource:///org/gnome/gjs/modules/script/package.js:206:19 start@resource:///org/gnome/gjs/modules/script/package.js:190:8 @/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17 ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I made a few changes to make the extension work on Gnome 40. And a small redesign.

