Fixed schedule date formatting (#20236)

DES-355

There's been an orphan in the schedule toast notification and the date
format was non-standard.
This commit is contained in:
Peter Zimon 2024-05-22 10:29:03 +02:00 committed by GitHub
parent 8bc035ccb7
commit fb44c2393c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1294,13 +1294,14 @@ export default class LexicalEditorController extends Controller {
description.push(`${!emailOnly ? 'and delivered ' : ''}to <span><strong>${recipientCount}</strong></span>`);
}
description.push(`on <span><strong>${publishedAtBlogTZ.format('MMM Do')}</strong></span>`);
description.push(`at <span><strong>${publishedAtBlogTZ.format('HH:mm')}</strong>`);
description.push(`on <span><strong>${publishedAtBlogTZ.format('D MMM YYYY')}</strong></span>`);
let timeZoneLabel = '';
if (publishedAtBlogTZ.utcOffset() === 0) {
description.push('(UTC)</span>');
timeZoneLabel = '(UTC)</span>';
} else {
description.push(`(UTC${publishedAtBlogTZ.format('Z').replace(/([+-])0/, '$1').replace(/:00/, '')})</span>`);
timeZoneLabel = `(UTC${publishedAtBlogTZ.format('Z').replace(/([+-])0/, '$1').replace(/:00/, '')})</span>`;
}
description.push(`at <span><strong>${publishedAtBlogTZ.format('HH:mm')}</strong>&nbsp;${timeZoneLabel}`);
description = htmlSafe(description.join(' '));