Skip to content

Commit

Permalink
Bypassing linux DateFormatter bug
Browse files Browse the repository at this point in the history
  • Loading branch information
MatsMoll committed May 5, 2019
1 parent cb70256 commit 2175660
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/HTMLKit/DateVariable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ struct DateVariable<T: ContextualTemplate>: CompiledTemplate {
throw Errors.unableToCopyFormatter
}
formatterCopy.locale = .init(identifier: locale)
// Used to bypass a Linux bug
formatterCopy.dateStyle = formatter.dateStyle
formatterCopy.timeStyle = formatter.timeStyle
return formatterCopy.string(from: date)
} else {
return formatter.string(from: date)
Expand Down

0 comments on commit 2175660

Please sign in to comment.