oncall-engine/engine/apps/schedules
Zachary Sistrunk 4afba220ea
Fix issue with DST starting/ending causing overlaps/gaps (#5266)
# What this PR does

This older version of recurring_ical_events does not call the pytz
.normalize() function, which can cause some invalid datetime objects to
return when a DST swap happens. For example: Nov 3, 2024 9:00 AM CDT
instead of the correct 8:00 AM CST). By calling tz.normalize on the end
date and checking if the time zone information changed, we can detect
when DST starts/stops and adjust the end date accordingly.

| | DST stopping on November 3, 2024: | DST starting on March 9, 2024 |

|-|-----------------------------------------|-----------------------------------|
| Before |
![image](https://github.com/user-attachments/assets/933bce80-9b6a-475b-88f2-6356d0e3a6fd)
|
![image](https://github.com/user-attachments/assets/264b816f-6f40-4f14-bbc0-1d03f7b74ac4)
| After |
![image](https://github.com/user-attachments/assets/fbd71991-c4f8-4685-a527-6dbb147b2cb6)
|
![image](https://github.com/user-attachments/assets/ccd932df-2ab4-4472-bc90-045372712f75)
|

## Which issue(s) this PR closes

Closes #5247

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.

---------

Co-authored-by: Matias Bordese <mbordese@gmail.com>
2024-11-20 17:04:25 +00:00
..
ical_events Fix issue with DST starting/ending causing overlaps/gaps (#5266) 2024-11-20 17:04:25 +00:00
migrations chore: remove deprecated AlertGroupPostMortem model + recently refactored/deprecated slack channel related columns (#5240) 2024-11-19 19:23:48 +00:00
models chore: remove deprecated AlertGroupPostMortem model + recently refactored/deprecated slack channel related columns (#5240) 2024-11-19 19:23:48 +00:00
tasks feat: convert schedule.channel (char field) to schedule.slack_channel (foreign key) (#5199) 2024-11-04 14:27:21 -05:00
tests Fix issue with DST starting/ending causing overlaps/gaps (#5266) 2024-11-20 17:04:25 +00:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
constants.py Optimize GET /schedules and /current_user_events internal api endpoints (#4169) 2024-04-11 14:46:51 +00:00
exceptions.py shift swap requests model + CRUD endpoints (#2597) 2023-07-21 19:35:19 +00:00
ical_utils.py chore: convert two slack channel ID char fields to foreign keys (#5224) 2024-11-04 13:34:06 -05:00