diff --git a/package-lock.json b/package-lock.json index 9a0647bd..629d89e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@quintype/amp", - "version": "2.19.2", + "version": "2.19.3-amp-locale-time.3", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index d186ad9a..e2b733c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@quintype/amp", - "version": "2.19.2", + "version": "2.19.3-amp-locale-time.3", "description": "Quintype's AMP component library for publisher apps to create amp layouts", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/molecules/date/published/date-published-base.tsx b/src/molecules/date/published/date-published-base.tsx index e270ce17..5747412a 100644 --- a/src/molecules/date/published/date-published-base.tsx +++ b/src/molecules/date/published/date-published-base.tsx @@ -10,6 +10,7 @@ export const DatePublishedBase = ({ story, format, prepend, config, type = "firs const languageCode = get(config, ["publisherConfig", "language", "ietf-code"], "en"); const localizationOpts = get(config, ["opts", "featureConfig", "localization"], {}); + const timeZone = get(config, ["additionalConfig", "general", "timeZone"], "Asia/Kolkata"); if ("useLocaleDateStampOnGenericStory" in localizationOpts) { const useLocale = @@ -24,7 +25,8 @@ export const DatePublishedBase = ({ story, format, prepend, config, type = "firs day: "numeric", hour: "numeric", minute: "numeric", - hour12: true + hour12: true, + timeZone: timeZone }); return ; } diff --git a/src/molecules/date/updated/date-updated.tsx b/src/molecules/date/updated/date-updated.tsx index 0bb8f86c..f49e4574 100644 --- a/src/molecules/date/updated/date-updated.tsx +++ b/src/molecules/date/updated/date-updated.tsx @@ -15,6 +15,7 @@ export const DateUpdatedBase = ({ story, prepend, config }: DateUpdatedTypes) => const languageCode = get(config, ["publisherConfig", "language", "ietf-code"]); const localizationOpts = get(config, ["opts", "featureConfig", "localization"], {}); + const timeZone = get(config, ["additionalConfig", "general", "timeZone"], "Asia/Kolkata"); if ("useLocaleDateStampOnGenericStory" in localizationOpts) { const useLocale = @@ -29,7 +30,8 @@ export const DateUpdatedBase = ({ story, prepend, config }: DateUpdatedTypes) => day: "numeric", hour: "numeric", minute: "numeric", - hour12: true + hour12: true, + timeZone: timeZone }); } } diff --git a/src/templates/live-blog/container-components.tsx b/src/templates/live-blog/container-components.tsx index 14d29d80..58dbad63 100644 --- a/src/templates/live-blog/container-components.tsx +++ b/src/templates/live-blog/container-components.tsx @@ -12,6 +12,7 @@ export const CardUpdatedAtBase = ({ story, config, timeStamp, card }: CardUpdate const cardTimeStampRender = get(config, ["opts", "render", "liveBlogCardTimeStamp"], null); const languageCode = get(config, ["publisherConfig", "language", "ietf-code"]); + const timeZone = get(config, ["additionalConfig", "general", "timeZone"], "Asia/Kolkata"); const localizationOpts = get(config, ["opts", "featureConfig", "localization"], {}); if (cardTimeStampRender) return cardTimeStampRender({ story, config, card }); @@ -35,7 +36,8 @@ export const CardUpdatedAtBase = ({ story, config, timeStamp, card }: CardUpdate day: "numeric", hour: "numeric", minute: "numeric", - hour12: true + hour12: true, + timeZone }); } }