Skip to content

Commit f2b9bfc

Browse files
committed
do not use locale if set to a different value
1 parent bbcbe28 commit f2b9bfc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Requires macOS 12.0 and higher.
2323
- Intel Virtual Machines now have a forced `board-id` property that complies with Apple's own logic/SOFA.
2424
- Thanks to [Mykola Grymalyuk](https://github.com/khronokernel) for the [PR](https://github.com/macadmins/nudge/pull/622)
2525
- Addresses [621](https://github.com/macadmins/nudge/issues/621)
26+
- `requiredInstallationDisplayFormat` was no longer being honored on Nudge versions 2.0.1 through 2.0.5 due to a regression
27+
- Addresses [627](https://github.com/macadmins/nudge/issues/627)
2628

2729
## [2.0.5] - 2024-07-24
2830
Requires macOS 12.0 and higher.

Nudge/Utilities/Utils.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ struct DateManager {
561561

562562
func coerceDateToString(date: Date, formatterString: String, locale: Locale? = nil) -> String {
563563
if formatterString == "MM/dd/yyyy" {
564-
// Use the specified locale or the current locale if none is provided
564+
// If using default, try to use the locale's values
565565
let dateFormatter = DateFormatter()
566566
dateFormatter.dateStyle = .short
567567
dateFormatter.timeStyle = .none
@@ -570,7 +570,7 @@ struct DateManager {
570570
} else {
571571
let formatter = DateFormatter()
572572
formatter.dateFormat = formatterString
573-
formatter.locale = locale ?? Locale.current
573+
print(formatter.string(from: date))
574574
return formatter.string(from: date)
575575
}
576576
}

0 commit comments

Comments
 (0)