Steps to Reproduce:
A sample code below
let usLocale = Locale(identifier: "en_US")
let gbLocale = Locale(identifier: "en_GB")
let template = "yLLLLd"
let usDateFormat = DateFormatter.dateFormat(fromTemplate: template, options: 0, locale: usLocale)!
// Date format for English (United States): "MMMM d, y"
let gbDateFormat = DateFormatter.dateFormat(fromTemplate: template, options: 0, locale: gbLocale)!
// Date format for English (United Kingdom): "d MMMM y"
Expected Results:
Expected result for the above shared code should be
// Date format for English (United States): "LLLL d, y"
// Date format for English (United Kingdom): "d LLLL y"
Actual Results:
Actual result for the above shared code is
// Date format for English (United States): "MMMM d, y"
// Date format for English (United Kingdom): "d MMMM y"
Description
Area: Foundation
Summary: DateFormatter.dateFormat(fromTemplate:options:locale:) & dateFormatter.setLocalizedDateFormatFromTemplate don't support all UNICODE LDML for DATES symbols (http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Field_Symbol_Table) although dateFormatter.dateFormat does support them.
Steps to Reproduce: A sample code below let usLocale = Locale(identifier: "en_US") let gbLocale = Locale(identifier: "en_GB") let template = "yLLLLd" let usDateFormat = DateFormatter.dateFormat(fromTemplate: template, options: 0, locale: usLocale)! // Date format for English (United States): "MMMM d, y" let gbDateFormat = DateFormatter.dateFormat(fromTemplate: template, options: 0, locale: gbLocale)! // Date format for English (United Kingdom): "d MMMM y"
Expected Results: Expected result for the above shared code should be // Date format for English (United States): "LLLL d, y" // Date format for English (United Kingdom): "d LLLL y"
Actual Results: Actual result for the above shared code is // Date format for English (United States): "MMMM d, y" // Date format for English (United Kingdom): "d MMMM y"
Version/Build:
Configuration:
- Product Version: Created: 2018-02-16T04:04:35.480820 Originated: 2018-02-15T00:00:00 Open Radar Link: http://www.openradar.me/37569176