Skip to content

Adding DateTimePeriod to Instant is not fully ISO-8601-compliant #487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dkhalanskyjb opened this issue Feb 18, 2025 · 0 comments
Open
Labels
bug Something isn't working
Milestone

Comments

@dkhalanskyjb
Copy link
Collaborator

ISO 8601 defines the period of one month as a fixed number of calendar days, specified by the calendar.

In DateTimePeriod + Instant arithmetics, we treat a month as a separate time scale unit, namely, we resolve the LocalDateTime on which we perform arithmetics internally after adding the months but before adding the days.

Adding months and days should instead be done as a single change, only consulting the calendar, and the time zone should only be used once all calendar-based operations are performed.

Earlier, I attempted to implement a solution in (#330) and didn't create an issue ticket, hoping for a quick resolution, but at this point, I should file it so that this doesn't get forgotten about.

@dkhalanskyjb dkhalanskyjb added breaking change This could break existing code bug Something isn't working and removed breaking change This could break existing code labels Apr 9, 2025
@dkhalanskyjb dkhalanskyjb added this to the 0.9.0 milestone Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant