diff --git a/backend/src/haagshistorischmuseum/src/haagshistorischmuseum/profiles/default/catalog.xml b/backend/src/haagshistorischmuseum/src/haagshistorischmuseum/profiles/default/catalog.xml index 9558132..b6799a3 100644 --- a/backend/src/haagshistorischmuseum/src/haagshistorischmuseum/profiles/default/catalog.xml +++ b/backend/src/haagshistorischmuseum/src/haagshistorischmuseum/profiles/default/catalog.xml @@ -1,13 +1,6 @@ - - + + + diff --git a/frontend/src/components/blocks/Listing/HomepageSliderTemplate.jsx b/frontend/src/components/blocks/Listing/HomepageSliderTemplate.jsx index 2668905..3445693 100644 --- a/frontend/src/components/blocks/Listing/HomepageSliderTemplate.jsx +++ b/frontend/src/components/blocks/Listing/HomepageSliderTemplate.jsx @@ -29,6 +29,7 @@ const messages = defineMessages({ const Card = ({ item, index, hideText }) => { const { title, start, end, whole_day } = item || {}; + const wholeDay = typeof whole_day === 'boolean' ? whole_day : false; const isEvent = item?.['@type'] === 'Event'; const endDate = new Date(end || Date.now()); const startDate = new Date(start || Date.now()); @@ -87,7 +88,7 @@ const Card = ({ item, index, hideText }) => { intl.locale, startDate, endDate, - whole_day, + wholeDay, )}

)} diff --git a/frontend/src/components/blocks/Listing/ListingTemplate.jsx b/frontend/src/components/blocks/Listing/ListingTemplate.jsx index 1c44dc3..184279d 100644 --- a/frontend/src/components/blocks/Listing/ListingTemplate.jsx +++ b/frontend/src/components/blocks/Listing/ListingTemplate.jsx @@ -8,6 +8,7 @@ import { Grid } from 'semantic-ui-react'; const Card = ({ item, showDescription = true, hideDates = false }) => { const intl = useIntl(); + const wholeDay = typeof item.whole_day === 'boolean' ? item.whole_day : false; const start = item.start ? new Date(item.start) : undefined; const end = item.end ? new Date(item.end) : undefined; const image = item?.image_field @@ -34,14 +35,14 @@ const Card = ({ item, showDescription = true, hideDates = false }) => { {item['@type'] === 'Event' && start && end && (
- {getDateRangeDescription(intl.locale, start, end)} + {getDateRangeDescription(intl.locale, start, end, wholeDay)}
)} {item['@type'] === 'News Item' && (
- {getDateRangeDescription(intl.locale, start, end)} + {getDateRangeDescription(intl.locale, start, end, wholeDay)}
)} diff --git a/frontend/src/helpers/getDateRangeDescription.js b/frontend/src/helpers/getDateRangeDescription.js index c3c3942..9b466b1 100644 --- a/frontend/src/helpers/getDateRangeDescription.js +++ b/frontend/src/helpers/getDateRangeDescription.js @@ -1,17 +1,16 @@ export function getDateRangeDescription(lang, start, end, wholeDay = true) { - // const startTime = new Intl.DateTimeFormat(lang, { - // hour: 'numeric', - // minute: 'numeric', - // }).format(start); + const startTime = new Intl.DateTimeFormat(lang, { + hour: 'numeric', + minute: 'numeric', + }).format(start); - // const endTime = new Intl.DateTimeFormat(lang, { - // hour: 'numeric', - // minute: 'numeric', - // }).format(end); + const endTime = new Intl.DateTimeFormat(lang, { + hour: 'numeric', + minute: 'numeric', + }).format(end); - // const time = - // wholeDay || startTime === endTime ? '' : `, ${startTime} - ${endTime}`; - const time = ''; + const time = + wholeDay || startTime === endTime ? '' : `, ${startTime} - ${endTime}`; if ( !end ||