Get weekdays in english iOS swift
Problem:
I had one date with me.I want to get the day name in english.
Solution:
extension Date {
func getWeekDaysEng() -> [String] {
var calendar = Calendar(identifier: .gregorian)
calendar.locale = Locale(identifier: "en_US_POSIX")
return calendar.weekdaySymbols
}
}
Comments
Post a Comment