Skip to content
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

feat(localDate): add dayOfWeek #21

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

mrnagydavid
Copy link
Contributor

In this PR, I have added the dayOfWeek function to the LocalDate.
This is because in AMG3, we sometimes need to know whether the date is on the weekend, and currently we need to use Date for this.

Because dayOfWeek is already implemented for LocalTime, I used the same implementation.

However, I have not implemented the setter, because:

  • it was not a pain point in AMG3
  • and I find it hard to reason about setting the day of week for an existing date. The user would need to remember or check the implementation to know if this moves the date forward or backward.

If we should add the setter for the sake of symmetry, let me know.

Copy link
Member

@kirillgroshkov kirillgroshkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Legit 👍

@kirillgroshkov kirillgroshkov merged commit a76bea9 into master Mar 26, 2024
3 checks passed
@kirillgroshkov kirillgroshkov deleted the feat/add-day-of-week-localdate branch March 26, 2024 20:59
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.

2 participants