scientist-softserv / britishlibrary

Other
3 stars 0 forks source link

Date formatting #484

Open grahamjevon opened 12 months ago

grahamjevon commented 12 months ago

Hi @cziaarm , we have noticed something that might be linked to the date formatting change you made (EDIT: If #464 fix is not in production yet, then I guess this is unrelated to the date formatting change you made).

If BX "date_published" field contains a date in the format "2023-12-17", everything works as expected. But if a date is entered in BX using the format "17/12/2023", some behaviour changes.

In both cases, the data is stored as expected in the "edit" page, but there are two differences:

  1. In the recent additions feed, the "17/12/2023" date has the whole date showing under the thumbnail rather than just the year.

Image

  1. In the metadata record page, the date is displayed based on the format it appeared in the csv.

Image

Image

cziaarm commented 12 months ago

Hi @grahamjevon

The view for these search results specifies the document.year_published following this to it's definition I can see that it expects YYYY-MM-DD format dates. Should be easy to amend this to handle DD/MM/YYYY too (i.e. grab just the year from those).