From d5f10260b784c4231dbf82ceea3209fa9a4ff558 Mon Sep 17 00:00:00 2001 From: David Ichim Date: Thu, 20 Oct 2022 14:05:14 +0300 Subject: [PATCH] change(cards): show date by default even when option isn't set - due to bug in Volto boolean when it doesn't take into consideration the default value and we have a requirement to always show the image, the title and the publication date for a card we check if the publication date isn't false therefore being ok when it is undefined. You will need to enable and disable the publication boolean flag if you really want to hide it --- src/components/UniversalCard/CardMeta.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/UniversalCard/CardMeta.jsx b/src/components/UniversalCard/CardMeta.jsx index a1f87dd6..18c00a82 100644 --- a/src/components/UniversalCard/CardMeta.jsx +++ b/src/components/UniversalCard/CardMeta.jsx @@ -7,7 +7,7 @@ const CardMeta = (props) => { const { item, itemModel = {}, head_title } = props; const { EffectiveDate } = item; const locale = config.settings.dateLocale || 'en-gb'; - const showDate = itemModel?.hasDate && EffectiveDate !== 'None'; + const showDate = itemModel.hasDate !== false && EffectiveDate !== 'None'; const showMeta = !!(head_title || (itemModel?.hasMetaType && item['@type'])); const show = showDate || showMeta;