We use DateTime component on the send page.
The DateTime component uses DateText for picking date.
We add site's offset before we pass the date to the DateTime.
The date-text component is nested in the DateTime and was also applying
offset on the date.
The second issue was we needed to convert the value to JS Date.
The MailPoet.Date.toDate expects the value to be in UTC, and we provided an already converted date.
So for offset -07:00
MailPoet.Date.toDate('2023-09-01');
ends up
Thu Aug 31 2023 17:00:00 GMT-0700 (Pacific Daylight Time) and calendar display's incorrect value.
This commit fixes it so that we don't touch offset in the DateText component.
[MAILPOET-6197]
In the renderer we only display the border if both
colour and size are set. Before this commit in the
editor we showed the border even if the colour
was transparent. This make it consistent and display
the border in the editor same way as in the renderer
[MAILPOET-6193]
pnpm dedupe upated Typescript.
The update of Typescript is more complex. We also need to update the eslint
because there is a warning that TS version is not supported and
eslint-config-airbnb-typescript was abandoned so we need to remove it and
do some changes in eslint config for TS
[MAILPOET-6191]
The package is a subdependency of @wordpress/scripts
I tried pnpm update axios but it didn't work.
I removed @wordpress/scripts and installed the same version again
and it updated the axios.
[MAILPOET-6191]
I update pnpm because the required version is quite old and
some devs are using newer version anyways and mixing versions
causes strange changelogs in package-lock.yml
I ran corepack up but I removed the sha from the version
because the previous version didn't have it as well.
[MAILPOET-6191]
There is no use case for the methods without the translation to site's timezone.
When the input doesn't specify the timezone we treat it as utc.
When the input provides timezone (e.g. '2024-08-13 10:00+02:00' or new Date('2024-08-13 10:00+02:00'))
We respect the timezone of the input and print the result in the site's timezone.
When the site's timezone is set +01:00
'2024-08-13 10:00' prints as 2024-08-13 11:00
'2024-08-13 10:00:+02:00' prints as 2024-08-13 09:00
new Date('2024-08-13 10:00:+02:00') prints as 2024-08-13 09:00
new Date('2024-08-13 10:00:+00:00') prints as 2024-08-13 11:00
[MAILPOET-6142]
I looked into using DBAL events for this but found that DBAL events
are deprecated so I went with middleware as they are recommended
as a replacement for the DBAL events.
[MAILPOET-6142]