Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Local Date Format for Required Date in v2.0 unless specified in JSON/Profile #615

Closed
Tribruin opened this issue Jul 24, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@Tribruin
Copy link

Currently the required date is displayed in MM/DD/YYYY format unless overridden in a profile/json file. Most EMEA and APAC countries use different formats such as DD/MM/YYYY or YYYY-MM-DD. While we can set a different format, that would mean having different settings by region and country.

Feature request is to use the Locale date format unless overridden in the profile/json.

@erikng
Copy link
Member

erikng commented Jul 24, 2024

Have no intention of doing this. You can use a different format that works for all regions vs just MM/DD. For example MMM

I already didn't want to support this feature, but I did so to be nice. Next request will be to support military vs non military (12 vs 24 hour formats).

if you really want this, please create two configs and maintain them.

@erikng erikng closed this as completed Jul 24, 2024
@erikng erikng reopened this Jul 24, 2024
@erikng
Copy link
Member

erikng commented Jul 24, 2024

I re read this.

Perhaps https://www.swiftyplace.com/blog/swift-date-formatting-10-steps-guide would work. But I don't know. Do you know if there is a built in method for this in swift?

@Tribruin
Copy link
Author

Tribruin commented Jul 24, 2024

Here is some pseduo code I pulled from ChatGPT and ran through xCode Playgrounds.

let currentDate = Date()

let dateFormat = DateFormatter.dateFormat(fromTemplate: "MMddyyyy", options: 0, locale: Locale.current)
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = dateFormat

print("Required Date: \(dateFormatter.string(from: currentDate))")

When I change the region it updates the format. Interesting it does NOT work if you change the date format seperately. It pulls the date format from the region.

@Tribruin Tribruin reopened this Jul 24, 2024
@erikng erikng mentioned this issue Jul 24, 2024
@erikng
Copy link
Member

erikng commented Jul 24, 2024

This should be fixed with 84fb165

https://github.com/macadmins/nudge/actions/runs/10079098388
go to Packages (you must be signed in) and then unzip it and run manually

@erikng erikng added the enhancement New feature or request label Jul 24, 2024
@Tribruin
Copy link
Author

I can confirm that is the date format is now set based on the format selected in System Settings. I also confirmed that setting the requiredInstallationDisplayFormat key still overrides the system format.

Thanks, as always, for your quick response.

@erikng
Copy link
Member

erikng commented Jul 24, 2024

Great. I will release v2.0.5 with this fix once the other person who requested a feature tests and confirms if it solves their issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants