diff --git a/Sources/Confidence/ConfidenceValue.swift b/Sources/Confidence/ConfidenceValue.swift index 08d2e563..afbe00c0 100644 --- a/Sources/Confidence/ConfidenceValue.swift +++ b/Sources/Confidence/ConfidenceValue.swift @@ -212,7 +212,7 @@ extension ConfidenceValueInternal { try container.encode(boolean) case .date(let dateComponents): let dateFormatter = DateFormatter() - dateFormatter.dateFormat = "dd-MM-yyyy" + dateFormatter.dateFormat = "yyyy-MM-dd" if let date = Calendar.current.date(from: dateComponents) { try container.encode(dateFormatter.string(from: date)) } else { diff --git a/Tests/ConfidenceTests/ConfidenceValueTests.swift b/Tests/ConfidenceTests/ConfidenceValueTests.swift index e6cd2c9c..f315b577 100644 --- a/Tests/ConfidenceTests/ConfidenceValueTests.swift +++ b/Tests/ConfidenceTests/ConfidenceValueTests.swift @@ -121,7 +121,7 @@ final class ConfidenceConfidenceValueTests: XCTestCase { let resultString = String(data: try encoder.encode(value), encoding: .utf8) let expectedString = """ {\"bool\":true, - \"date\":\"03-04-2024\", + \"date\":\"2024-04-03\", \"double\":4.5, \"int\":3, \"list\":[3,5],