Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit ab84f68

Browse files
committed
Explicitly decode Activity published using ISO8601 with ms
1 parent f5d2ee8 commit ab84f68

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

WordPressKit/Activity.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ public struct Activity: Decodable {
4848
let contentText = content["text"] as? String else {
4949
throw Error.missingContentText
5050
}
51-
guard let published = try container.decodeIfPresent(Date.self, forKey: .published) else {
51+
guard
52+
let publishedString = try container.decodeIfPresent(String.self, forKey: .published),
53+
let published = Date.dateWithISO8601WithMillisecondsString(publishedString) else {
5254
throw Error.missingPublishedDate
5355
}
5456

0 commit comments

Comments
 (0)