Fixed variable date formatting in new email flow

refs https://github.com/TryGhost/Ghost/actions/runs/3892250013/jobs/6643448457

Depending on the environment the date formatting in a newsletter could change. Now it is always set to the DD MMM YYYY format (like the old flow).
This commit is contained in:
Simon Backx 2023-01-11 12:26:09 +01:00
parent 6a664d11b9
commit 9650521376

View File

@ -514,7 +514,7 @@ class EmailRenderer {
const {href: postFeatureImage, width: postFeatureImageWidth} = await this.limitImageWidth(post.get('feature_image'));
const timezone = this.#settingsCache.get('timezone');
const publishedAt = (post.get('published_at') ? DateTime.fromJSDate(post.get('published_at')) : DateTime.local()).setZone(timezone).toLocaleString({
const publishedAt = (post.get('published_at') ? DateTime.fromJSDate(post.get('published_at')) : DateTime.local()).setZone(timezone).setLocale('en-gb').toLocaleString({
year: 'numeric',
month: 'short',
day: 'numeric'