Skip to content

Commit

Permalink
change(cards): show date by default even when option isn't set
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
ichim-david committed Oct 20, 2022
1 parent 0ce9248 commit d5f1026
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/UniversalCard/CardMeta.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit d5f1026

Please sign in to comment.