Skip to content

Commit

Permalink
Fix date format
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziodemaria committed Apr 5, 2024
1 parent cf1a7b0 commit a3a6b4d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/Confidence/ConfidenceValue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion Tests/ConfidenceTests/ConfidenceValueTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit a3a6b4d

Please sign in to comment.