From 258547a722e9cc36a064c6a0c14ef9f1214f61c1 Mon Sep 17 00:00:00 2001 From: Brian Miller Date: Wed, 21 Jun 2023 10:05:39 -0500 Subject: [PATCH 1/2] Add muli date formate/timezone to section feed node You can now pass in a multiDateFormats Array of { format, timezone }. It will loop over and render the publishdate with multiple formats and timezones. --- .../components/nodes/section-feed-content.marko | 17 +++++++++++++++++ .../scss/components/blocks/_section-feed.scss | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/packages/marko-web-theme-monorail/components/nodes/section-feed-content.marko b/packages/marko-web-theme-monorail/components/nodes/section-feed-content.marko index 3f1c676e6..9600ac774 100644 --- a/packages/marko-web-theme-monorail/components/nodes/section-feed-content.marko +++ b/packages/marko-web-theme-monorail/components/nodes/section-feed-content.marko @@ -18,6 +18,8 @@ $ const withBody = defaultValue(input.withBody, false); $ const withAddress = defaultValue(input.withAddress, (content.type === "company")); $ const withDates = defaultValue(input.withDates, true); $ const dateFormat = defaultValue(input.dateFormat, "MMMM D, YYYY"); +$ const multiDateFormats = input.multiDateFormats; + $ const isUpcoming = content.startDate > Date.now(); $ if (isUpcoming) modifiers.push("upcoming"); $ const withSection = defaultValue(input.withSection, true); @@ -104,6 +106,21 @@ $ const blockName = "section-feed-content-node"; <${input.date} /> + + + + $ const dateFormat = dateObj.dateFormat || dateFormat; + $ const timezone = dateObj.timezone || "America/Chicago"; + $ console.warn('inside: ', dateFormat.timezone, timezone); + + + +
diff --git a/packages/marko-web-theme-monorail/scss/components/blocks/_section-feed.scss b/packages/marko-web-theme-monorail/scss/components/blocks/_section-feed.scss index 633d76cae..8fbfc8837 100644 --- a/packages/marko-web-theme-monorail/scss/components/blocks/_section-feed.scss +++ b/packages/marko-web-theme-monorail/scss/components/blocks/_section-feed.scss @@ -93,6 +93,11 @@ } } + &__multidates { + display: flex; + flex-direction: row; + } + &__content-company { font-weight: $theme-content-attribution-prefix-font-weight; &::before { From 3fc3943d177fe03d3b661bcdf7fec200641ae7ae Mon Sep 17 00:00:00 2001 From: Brandon Krigbaum Date: Wed, 21 Jun 2023 11:52:48 -0500 Subject: [PATCH 2/2] Remove console.warn() --- .../components/nodes/section-feed-content.marko | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/marko-web-theme-monorail/components/nodes/section-feed-content.marko b/packages/marko-web-theme-monorail/components/nodes/section-feed-content.marko index 9600ac774..67e4f02a9 100644 --- a/packages/marko-web-theme-monorail/components/nodes/section-feed-content.marko +++ b/packages/marko-web-theme-monorail/components/nodes/section-feed-content.marko @@ -111,7 +111,6 @@ $ const blockName = "section-feed-content-node"; $ const dateFormat = dateObj.dateFormat || dateFormat; $ const timezone = dateObj.timezone || "America/Chicago"; - $ console.warn('inside: ', dateFormat.timezone, timezone);