Skip to content

Replace dayOfMonth with day and monthNumber with month #387

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

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

dkhalanskyjb
Copy link
Collaborator

@dkhalanskyjb dkhalanskyjb commented Apr 19, 2024

monthNumber is still called that in the formatting facilities to distinguish monthNumber from monthName, and also in DateTimeComponents because monthNumber can contain out-of-bounds data and is useful even aside from being a view of Month.

Fixes #84

@dkhalanskyjb dkhalanskyjb force-pushed the rename-dayOfMonth-and-monthNumber branch 2 times, most recently from a07cb8d to 8885ea5 Compare May 27, 2024 08:27
@dkhalanskyjb dkhalanskyjb marked this pull request as ready for review May 27, 2024 09:51
@dkhalanskyjb dkhalanskyjb requested a review from ilya-g July 19, 2024 12:57
@dkhalanskyjb dkhalanskyjb force-pushed the rename-dayOfMonth-and-monthNumber branch 2 times, most recently from d9fcdb9 to 4548e85 Compare November 14, 2024 13:19
@dkhalanskyjb
Copy link
Collaborator Author

With IntelliJ IDEA 2024.2.4, typing date.dayOfMonth and accepting the replacement suggestion from the IDE will erase dayOfMonth (see https://youtrack.jetbrains.com/issue/KTIJ-29647), but I didn't manage to break any realistic code with it. Whenever dayOfMonth is actually assigned to a variable, passed to a function, or has a method call performed on it, dayOfMonth will be correctly replaced with day. I think we can simply proceed with this the usual way, despite the IDE behavior.

`monthNumber` is still called that in the formatting facilities
to distinguish `monthNumber` from `monthName`, and also in
`DateTimeComponents` because `monthNumber` can contain
out-of-bounds data and is useful even aside from being a view of
`Month`.

Fixes #84
@dkhalanskyjb dkhalanskyjb force-pushed the rename-dayOfMonth-and-monthNumber branch from 4548e85 to 3c2f2bf Compare March 17, 2025 12:41
@dkhalanskyjb dkhalanskyjb merged commit 021c97b into master Mar 17, 2025
1 check passed
@dkhalanskyjb dkhalanskyjb deleted the rename-dayOfMonth-and-monthNumber branch March 17, 2025 14:16
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.

Simplify LocalDate(Time) constructor parameter names
2 participants