analytics
analytics copied to clipboard
Remove Timex from Plausible.Timezones
Continues https://github.com/plausible/analytics/pull/4338
Changes
This PR continues the removal of Timex by updating Plausible.Timezones to use stdlib instead of Timex.
This includes:
- replacing Timex.Timezone.convert/2 with DateTime.shift_zone/2
- replacing Timex.to_datetime/2 with DateTime.from_naive/2 or DateTime.new/3 (for date -> datetime)
- replacing Timex.to_date/1 with DateTime.to_date/1
Unlike the previous PRs this one requires updates to the tests since Timex logic is wrong:
- Timex does not handle gaps in wall time: https://github.com/plausible/analytics/pull/3899#discussion_r1525956437
- Timex confuses + and - in Etc/GMT timezones: https://github.com/bitwalker/timex/issues/685
Tests
- [x] Automated tests have been updated
Changelog
- [x] No need to update changelog.
Documentation
- [x] This change does not need a documentation update
Dark mode
- [x] This PR does not change the UI
| Preview environment👷🏼♀️🏗️ |
|---|
| PR-3899 |