Skip to content

Fix Time#at_beginning_of_week,#at_end_of_week to respect local timezone#16113

Merged
straight-shoota merged 4 commits intocrystal-lang:masterfrom
straight-shoota:fix/time.at_beginning_of_week
Aug 29, 2025
Merged

Fix Time#at_beginning_of_week,#at_end_of_week to respect local timezone#16113
straight-shoota merged 4 commits intocrystal-lang:masterfrom
straight-shoota:fix/time.at_beginning_of_week

Conversation

@straight-shoota
Copy link
Member

Resolves #16112

@straight-shoota straight-shoota self-assigned this Aug 26, 2025
@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:time labels Aug 26, 2025
straight-shoota and others added 2 commits August 26, 2025 18:00
Co-authored-by: Sijawusz Pur Rahnama <sija@sija.pl>
@HertzDevil
Copy link
Contributor

HertzDevil commented Aug 27, 2025

It looks like Asia/Jerusalem isn't on Alpine Linux's tzdata?

If all else fails you could use .posix_tz in the specs to remove the dependency on any particular tzdata release.

@straight-shoota
Copy link
Member Author

We should use our own TZDB copy (with_zoneinfo) like in other places, to not rely on the OS.

Btw. the reason for this failure is probably that the aarch64 build image uses an older alpine version (3.20).

@straight-shoota straight-shoota added this to the 1.18.0 milestone Aug 27, 2025
@straight-shoota straight-shoota merged commit 18b5703 into crystal-lang:master Aug 29, 2025
39 checks passed
@straight-shoota straight-shoota deleted the fix/time.at_beginning_of_week branch August 29, 2025 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:time

Projects

None yet

Development

Successfully merging this pull request may close these issues.

at_beginning_of_week returns incorrect day around switch from DST

4 participants