You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
In the task structure multiple fields represents dates but are typed as strings. It would be an improvement to change these dates to a Date type object and not a string,
Currently the decoder is not able to transform the returned date format by Meilisearch into a Date object in swift. See error:
▿ Swift.DecodingError.dataCorrupted
▿ dataCorrupted: Swift.DecodingError.Context
▿ codingPath: 1 element
- CodingKeys(stringValue: "duration", intValue: nil)
- debugDescription: "Date string does not match format expected by formatter."
- underlyingError: nil
Meilisearch is returned date the following way:
"enqueuedAt": "2021-08-10T14:29:17.000000Z",
Which per the specs is described like this (for example with enqueuedAt):
| enqueuedAt | string | Represent the date and time as `ISO-8601` format when the task has been enqueued |
The text was updated successfully, but these errors were encountered:
For the moment there are two API in swift. One called Date that has a ISO8601Format(_:) method but only compatible with MacOS 12+
The other is called DateFormatter and I believe with this API it is easy
Description
In the task structure multiple fields represents dates but are typed as
strings
. It would be an improvement to change these dates to aDate
type object and not a string,Example can be found here:
meilisearch-swift/Sources/MeiliSearch/Model/Task.swift
Line 34 in ae7ad35
Currently the decoder is not able to transform the returned date format by Meilisearch into a
Date
object in swift. See error:Meilisearch is returned date the following way:
Which per the specs is described like this (for example with enqueuedAt):
The text was updated successfully, but these errors were encountered: