mirror of
https://github.com/tappollo/WWDC.git
synced 2026-04-30 21:02:02 +08:00
Fixed locale for date adapter (Closes #225)
This commit is contained in:
@@ -17,7 +17,7 @@ final class DateAdapter: Adapter {
|
||||
func adapt(_ input: String) -> Result<Date, AdapterError> {
|
||||
let formatter = DateFormatter()
|
||||
formatter.dateFormat = "yyyy-MM-dd"
|
||||
formatter.locale = Locale.current
|
||||
formatter.locale = Locale(identifier: "en-US")
|
||||
formatter.timeZone = TimeZone.current
|
||||
|
||||
if let date = formatter.date(from: input) {
|
||||
@@ -35,7 +35,7 @@ final class DateTimeAdapter: Adapter {
|
||||
func adapt(_ input: String) -> Result<Date, AdapterError> {
|
||||
let formatter = DateFormatter()
|
||||
formatter.dateFormat = ConfCoreDateFormat
|
||||
formatter.locale = Locale.current
|
||||
formatter.locale = Locale(identifier: "en-US")
|
||||
formatter.timeZone = TimeZone.current
|
||||
|
||||
if let date = formatter.date(from: input) {
|
||||
|
||||
Reference in New Issue
Block a user