From de20dd5081b4831bb03374c912af76311d80400b Mon Sep 17 00:00:00 2001 From: teawithfruit Date: Fri, 10 May 2019 17:57:34 +0200 Subject: [PATCH] Added function to get always the english weekday title --- Sources/Weekday/Weekday.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Sources/Weekday/Weekday.swift b/Sources/Weekday/Weekday.swift index 822546d..5499ac9 100644 --- a/Sources/Weekday/Weekday.swift +++ b/Sources/Weekday/Weekday.swift @@ -179,6 +179,15 @@ public enum Weekday: Int { return sundayStartingRawValue == weekdayIndex } + public var isoName: String { + let dateFormatter = DateFormatter() + dateFormatter.locale = Locale(identifier: "en_US") + + let weekdays = dateFormatter.standaloneWeekdaySymbols! + + return weekdays[self.indexValueForCalendar] + } + public var localizedName: String { struct Static { static let weekdays = DateFormatter().standaloneWeekdaySymbols!