ckan / ckanext-scheming

Easy, shareable custom CKAN schemas
Other
85 stars 163 forks source link

date snippet shows the time, like datetime #314

Open frafra opened 2 years ago

frafra commented 2 years ago

https://github.com/ckan/ckanext-scheming/blob/1307aedec8ae8b1c4c86d33ede654a3d9afe7fa3/ckanext/scheming/templates/scheming/display_snippets/date.html#L2

Shouldn't that be: {{ data[field.field_name].split('T')[0] }} (see T as separator)? If I apply this change, I am able to see the dates correctly without the time.

frafra commented 2 years ago

I think that the current code can be fine if the data are stored as simple date from the very beginning: https://github.com/ckan/ckanext-scheming/blob/d441d2dee72a7382a73de4185b01fae4b2d37473/ckanext/scheming/validation.py#L466-L481

I still do not understand what split() should do, if it wasn't meant to remove the time.