Skip to content

Commit

Permalink
Merge pull request #1839 from navikt/vise-forst-publisert-pa-forsiden
Browse files Browse the repository at this point in the history
Endrer til å vise først publisert eller modifiedTime som fallback
  • Loading branch information
terjeofnorway committed May 24, 2024
2 parents 89d3a03 + 968e0b2 commit 865247c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export const FrontpageCurrentTopicsPart = ({
return null;
}

const displayDate = item.publish?.first ?? item.modifiedTime;

return (
<li key={item._id}>
<LinkPanelNavno
Expand All @@ -52,7 +54,7 @@ export const FrontpageCurrentTopicsPart = ({
>
<span className={style.date}>
{formatDate({
datetime: item.createdTime,
datetime: displayDate,
language: language,
short: true,
year: true,
Expand Down

0 comments on commit 865247c

Please sign in to comment.