From f2b9bfc3a7bbadc9271ca141ab0c10532b8fd750 Mon Sep 17 00:00:00 2001 From: Erik Gomez Date: Thu, 1 Aug 2024 07:50:10 -0500 Subject: [PATCH] do not use locale if set to a different value --- CHANGELOG.md | 2 ++ Nudge/Utilities/Utils.swift | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddc73b6a..45d57f5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ Requires macOS 12.0 and higher. - Intel Virtual Machines now have a forced `board-id` property that complies with Apple's own logic/SOFA. - Thanks to [Mykola Grymalyuk](https://github.com/khronokernel) for the [PR](https://github.com/macadmins/nudge/pull/622) - Addresses [621](https://github.com/macadmins/nudge/issues/621) +- `requiredInstallationDisplayFormat` was no longer being honored on Nudge versions 2.0.1 through 2.0.5 due to a regression + - Addresses [627](https://github.com/macadmins/nudge/issues/627) ## [2.0.5] - 2024-07-24 Requires macOS 12.0 and higher. diff --git a/Nudge/Utilities/Utils.swift b/Nudge/Utilities/Utils.swift index cc559aae..843ec5f1 100644 --- a/Nudge/Utilities/Utils.swift +++ b/Nudge/Utilities/Utils.swift @@ -561,7 +561,7 @@ struct DateManager { func coerceDateToString(date: Date, formatterString: String, locale: Locale? = nil) -> String { if formatterString == "MM/dd/yyyy" { - // Use the specified locale or the current locale if none is provided + // If using default, try to use the locale's values let dateFormatter = DateFormatter() dateFormatter.dateStyle = .short dateFormatter.timeStyle = .none @@ -570,7 +570,7 @@ struct DateManager { } else { let formatter = DateFormatter() formatter.dateFormat = formatterString - formatter.locale = locale ?? Locale.current + print(formatter.string(from: date)) return formatter.string(from: date) } }