Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(publish time): fix amp publish time #474

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 3 additions & 1 deletion src/molecules/date/published/date-published-base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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 <DateTime formattedDate={date} prepend={prepend} />;
}
Expand Down
4 changes: 3 additions & 1 deletion src/molecules/date/updated/date-updated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -29,7 +30,8 @@ export const DateUpdatedBase = ({ story, prepend, config }: DateUpdatedTypes) =>
day: "numeric",
hour: "numeric",
minute: "numeric",
hour12: true
hour12: true,
timeZone: timeZone
});
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/templates/live-blog/container-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand All @@ -35,7 +36,8 @@ export const CardUpdatedAtBase = ({ story, config, timeStamp, card }: CardUpdate
day: "numeric",
hour: "numeric",
minute: "numeric",
hour12: true
hour12: true,
timeZone
});
}
}
Expand Down