Skip to content

Date Formatter is Wrong: YYYY instead of yyyy #505

@ErMejo74

Description

@ErMejo74

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions