-
On the /collections/{collection-id}/items/{item-id} endpoint, certain fields, such as assets.created or item.properties.published, are correctly formatted as UTC date strings, while others are returned as-is, resulting in inconsistencies in the date representations. In the backend, I attempted to normalize all date values by converting them to datetime.datetime objects in Python. However, this approach does not work as expected, since the Created field in the response is required to be a string rather than a datetime object. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The browser doesn't detect that the strings are datetimes (there's no datetime datatype in JSON).
Example for the first option, to be added to your fields.config.js: Registry.addExtension("cadip", "CADIP");
Registry.addMetadataField("cadip:planned_data_start", {
label: "Planned Start",
format: "Timestamp"
}); |
Beta Was this translation helpful? Give feedback.
The browser doesn't detect that the strings are datetimes (there's no datetime datatype in JSON).
You need to make the browser aware that the fields contain datetimes.
There are two options for this:
Example for the first option, to be added to your fields.config.js: