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

Date Formatter is Wrong: YYYY instead of yyyy #505

Open
ErMejo74 opened this issue Dec 30, 2021 · 1 comment · Fixed by #506
Open

Date Formatter is Wrong: YYYY instead of yyyy #505

ErMejo74 opened this issue Dec 30, 2021 · 1 comment · Fixed by #506

Comments

@ErMejo74
Copy link

As noticed by Dr. Andrew Sempere you have a glaring mistake in the date formatter.

As explained by Apple's documentation:

. A common mistake is to use YYYY. yyyy specifies the calendar year whereas YYYY specifies the year (of “Week of Year”), used in the ISO year-week calendar. In most cases, yyyy and YYYY yield the same number, however they may be different. Typically you should use the calendar year.

So, all these format strings should contain yyyy and not YYYY:

:~/swisscovid-app-ios$ fgrep -r YYYY *
DP3TApp/Screens/Homescreen/InformBroadcast/CheckInSelection/CheckInSelectionViewController.swift:        formatter.dateFormat = "dd.mm.YYYY"
DP3TApp/Logic/Helpers/DateFormatter.swift:        dateFormatter.dateFormat = "dd.MM.YYYY"
DP3TApp/Logic/Helpers/DateFormatter.swift:        dateFormatter.dateFormat = "dd. MMMM YYYY"
DP3TApp/Logic/CheckIn/ProblematicEventsManager.swift:        formatter.dateFormat = "E, dd MMM YYYY HH:mm:ss zzz"
@ErMejo74 ErMejo74 changed the title Date Formatter is Wrong!!! Date Formatter is Wrong: YYYY instead of yyyy Dec 30, 2021
stmitt added a commit that referenced this issue Jan 7, 2022
@stmitt
Copy link
Contributor

stmitt commented Jan 7, 2022

Thank you very much for raising this issue. You are right we are using the wrong year specifier, therefore exposures could have been displayed with the wrong year.
I fixed the Issue with PR #506.

@stmitt stmitt linked a pull request Jan 7, 2022 that will close this issue
stmitt added a commit that referenced this issue Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants