It seems DateFormatter.date(from:) can't parse any date string in TimelineProvider.getTimeline(in:completion:) while DateFormatter.string(from:) works.
Result:
Is it a bug or am I doing wrong?
Code Block language let formatter = DateFormatter() formatter.locale = Locale(identifier: "en_US_POSIX") formatter.dateFormat = "yyyyMMdd" let date = formatter.date(from: "20201006") let string = formatter.string(from: Date())
Result:
Code Block date = (Date?) nil string = (String) "20201006"
Is it a bug or am I doing wrong?