From f135093e82d424179354c40f68eeca66065698c7 Mon Sep 17 00:00:00 2001 From: Kailas Nadh U <53608019+kailasnadh790@users.noreply.github.com> Date: Wed, 6 Dec 2023 12:43:25 -0500 Subject: [PATCH] Update cigaradvisor/blocks/article-teaser/article-teaser.js Co-authored-by: Bryan Stopp --- cigaradvisor/blocks/article-teaser/article-teaser.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cigaradvisor/blocks/article-teaser/article-teaser.js b/cigaradvisor/blocks/article-teaser/article-teaser.js index bcb2bd55..9547592e 100644 --- a/cigaradvisor/blocks/article-teaser/article-teaser.js +++ b/cigaradvisor/blocks/article-teaser/article-teaser.js @@ -32,8 +32,7 @@ export default async function decorate(block) { const articleCategory = articleInfo.category; const articleCategoryInfo = categoryListData.find((obj) => obj.category === articleCategory); const articleCategoryLink = articleCategoryInfo.categoryLink; - const formattedDate = formatDate(articleInfo.publishedDate).split('|')[0]; - const datetimeAttr = formatDate(articleInfo.publishedDate).split('|')[1]; + const [formattedDate, datetimeAttr] = formatDate(articleInfo.publishedDate).split('|'); const authorNameHyphenSeparated = articleInfo.author.split(' ').join('-'); const authorLink = `${window.hlx.codeBasePath}/author/drafts/${authorNameHyphenSeparated.toLowerCase()}`; block.innerHTML = `