From 39a1ccb3e69d00570ec04c00c4fc8c3f5bdf7547 Mon Sep 17 00:00:00 2001 From: marinierb Date: Sun, 12 Jul 2026 21:05:49 -0400 Subject: [PATCH 1/2] Apply GNOME user settings to "Last cheched" date and time format. --- extension.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/extension.js b/extension.js index 646f9e8..8b79e21 100644 --- a/extension.js +++ b/extension.js @@ -199,8 +199,10 @@ class FedoraUpdateIndicator extends Button { // Load settings this._settings = this._extension.getSettings(); + this._desktopSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.interface' }); this._settingsPositionChangedId = this._settings.connect('changed', this._positionChanged.bind(this)); this._settingsChangedId = this._settings.connect('changed', this._applySettings.bind(this)); + this._desktopSettingsChangedId = this._desktopSettings.connect('changed::clock-format', this._updateLastCheckMenu.bind(this)); this._applySettings(); if (FIRST_BOOT) { @@ -328,6 +330,10 @@ class FedoraUpdateIndicator extends Button { this._settings.disconnect(this._settingsChangedId); this._settingsChangedId = null; } + if (this._desktopSettingsChangedId) { + this._desktopSettings.disconnect(this._desktopSettingsChangedId); + this._desktopSettingsChangedId = null; + } } if (this._notifSource) { // Delete the notification source, which lay still have a notification shown @@ -430,8 +436,19 @@ class FedoraUpdateIndicator extends Button { } } + _formatLastCheckedTime() { + if (!LAST_CHECK) { + return ''; + } + + const date = GLib.DateTime.new_from_unix_local(Math.floor(LAST_CHECK.getTime() / 1000)); + const clockFormat = this._desktopSettings?.get_enum('clock-format') ?? 0; + const timeFormat = clockFormat === 1 ? '%x %I:%M %p' : '%x %H:%M'; + return date.format(timeFormat); + } + _updateLastCheckMenu() { - this.timeCheckedMenu.label.set_text( _("Last checked") + " " + LAST_CHECK.toLocaleString() ); + this.timeCheckedMenu.label.set_text( _("Last checked") + " " + this._formatLastCheckedTime() ); this.timeCheckedMenu.visible = SHOW_TIMECHECKED; } From b3c7aedc04a5130359fd26e6509c962db69f3c95 Mon Sep 17 00:00:00 2001 From: Bruno Marinier Date: Mon, 13 Jul 2026 09:41:40 -0400 Subject: [PATCH 2/2] Update extension.js Co-authored-by: Ralph Plawetzki --- extension.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension.js b/extension.js index 8b79e21..4daed1c 100644 --- a/extension.js +++ b/extension.js @@ -443,7 +443,7 @@ class FedoraUpdateIndicator extends Button { const date = GLib.DateTime.new_from_unix_local(Math.floor(LAST_CHECK.getTime() / 1000)); const clockFormat = this._desktopSettings?.get_enum('clock-format') ?? 0; - const timeFormat = clockFormat === 1 ? '%x %I:%M %p' : '%x %H:%M'; + const timeFormat = clockFormat === 1 ? '%x %I:%M %p' : '%x %H:%M:%S'; return date.format(timeFormat); }