Change language automatically

This commit is contained in:
2019-04-01 20:53:00 -05:00
parent c380abad5a
commit 6af576c09c
33 changed files with 345 additions and 390 deletions

View File

@@ -44,6 +44,10 @@ extension Date {
class IosLocalDateFormatter : NSObject, LocalDateFormatter {
let fmt = DateFormatter()
override init() {
fmt.locale = Locale(identifier: NSLocale.preferredLanguages.first!)
}
func shortMonthName(date: LocalDate) -> String {
fmt.dateFormat = "MMM"
return fmt.string(from: date.iosDate)