Skip to content

fix: give parsed timestamps a stdlib tzinfo - #96

Merged
tobixen merged 1 commit into
masterfrom
fix/dateparser-tzinfo
Nov 25, 2026
Merged

tobixen merged 1 commit into
masterfrom
fix/dateparser-tzinfo

Conversation

@tobixen

@tobixen tobixen commented Nov 24, 2026

Copy link
Copy Markdown
Member

Commit message:

fix: give parsed timestamps a stdlib tzinfo

dateparser returns pytz zones when a timezone is configured, and its
own pytz look-alike StaticTzInfo for an explicit UTC offset.
recurring_ical_events took StaticTzInfo for pytz and crashed calling
normalize() on it, so `plann select --start 2026-11-21T05:00+01:00`
failed on recurring events.  parse_dt now swaps such zones for a
zoneinfo zone or a fixed offset, keeping the wall clock.

https://github.com/niccokunzmann/python-recurring-ical-events/issues/311

Prompts:
> Look into
> https://github.com/niccokunzmann/python-recurring-ical-events/issues/311#issuecomment-7112994959
> - am I using the wrong libraries for handling timezones in plann?

> This sounds like an upstream problem with dateparser?  But yes, please
> implement [converting dateparser's tzinfo to zoneinfo or a
> fixed offset in parse_dt]. (...)

Assisted-By: Claude Opus 5.5
Reviewed-by: Tobias Brox <tobias@redpill-linpro.com>

🤖 Generated with Claude Code

dateparser returns pytz zones when a timezone is configured, and its
own pytz look-alike StaticTzInfo for an explicit UTC offset.
recurring_ical_events took StaticTzInfo for pytz and crashed calling
normalize() on it, so `plann select --start 2026-11-21T05:00+01:00`
failed on recurring events.  parse_dt now swaps such zones for a
zoneinfo zone or a fixed offset, keeping the wall clock.

niccokunzmann/python-recurring-ical-events#311

Prompts:
> Look into
> niccokunzmann/python-recurring-ical-events#311 (comment)
> - am I using the wrong libraries for handling timezones in plann?

> This sounds like an upstream problem with dateparser?  But yes, please
> implement [converting dateparser's tzinfo to zoneinfo or a
> fixed offset in parse_dt]. (...)

Assisted-By: Claude Opus 5.5
Reviewed-by: Tobias Brox <tobias@redpill-linpro.com>
@tobixen
tobixen merged commit dbd43d5 into master Nov 25, 2026
9 checks passed
@tobixen
tobixen deleted the fix/dateparser-tzinfo branch November 25, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant