mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-09 02:28:51 -06:00
Change language automatically
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user