swift - LocalizedString of DateFormatter is different from iOS default calendar app -
when try localizedstring
dateformatter
, output different format ios default calendar app shows.
dateformatter
locale shows (for datestyle full)
tuesday, august 15, 2017
where ios default calendar app shows
tue, aug 15, 2017
dateformatter
kr locale shows (for datestyle full)
2017년 8월 15일 화요일
where ios default calendar app shows
2017년 8월 15일 (화)
how localizedstring
shown in ios default calendar app? should create custom format locale?
none of standard styles show abbreviated weekday , month name.
one option use setlocalizeddateformatfromtemplate
.
let df = dateformatter() df.setlocalizeddateformatfromtemplate("eee mmm dd yyyy") let string = df.string(from: date())
Comments
Post a Comment