environment: Remove toLocaleFormat and add dateUtils for date formatting

`toLocaleFormat` is now `formatDateWithCFormatString` and formatTime and
formatTimeSpan are moved into dateUtils.

Instead of overriding system.clearDateCaches, add a helper in dateUtils.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2827>
This commit is contained in:
Evan Welsh
2023-07-07 17:58:11 -07:00
parent 88eb04a42c
commit 8d48dc8c6f
8 changed files with 222 additions and 192 deletions

View File

@ -17,7 +17,7 @@ const Layout = imports.ui.layout;
const Main = imports.ui.main;
const MessageTray = imports.ui.messageTray;
const SwipeTracker = imports.ui.swipeTracker;
const {formatDateWithCFormatString} = imports.misc.dateUtils;
const AuthPrompt = imports.gdm.authPrompt;
// The timeout before going back automatically to the lock screen (in seconds)
@ -367,7 +367,7 @@ class UnlockDialogClock extends St.BoxLayout {
/* Translators: This is a time format for a date in
long format */
let dateFormat = Shell.util_translate_time_string(N_('%A %B %-d'));
this._date.text = date.toLocaleFormat(dateFormat);
this._date.text = formatDateWithCFormatString(date, dateFormat);
}
_updateHint() {