Skip to content

Commit

Permalink
do not use locale if set to a different value
Browse files Browse the repository at this point in the history
  • Loading branch information
erikng committed Aug 1, 2024
1 parent bbcbe28 commit f2b9bfc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions Nudge/Utilities/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
}
Expand Down

0 comments on commit f2b9bfc

Please sign in to comment.