From 2175660cce421f3245b78d3af06b49fd66deaadc Mon Sep 17 00:00:00 2001 From: Mats Eikeland Mollestad Date: Sun, 5 May 2019 13:52:30 +0200 Subject: [PATCH] Bypassing linux DateFormatter bug --- Sources/HTMLKit/DateVariable.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/HTMLKit/DateVariable.swift b/Sources/HTMLKit/DateVariable.swift index a4f6351d..2b722311 100644 --- a/Sources/HTMLKit/DateVariable.swift +++ b/Sources/HTMLKit/DateVariable.swift @@ -51,6 +51,9 @@ struct DateVariable: 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)