-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
parts object so we can work around the off by one day bug #4208
Comments
Looks clean. Also keep the ability for developers to use the date library of their choice (luxon, datejs, Day.js etc) |
@martijnrusschen does the proposal look good to you? |
Sorry for the delay. Makes sense to me. |
Thank you for approving the solution. Unfortunately our team has moved into another focus and will be unable to implement this. However, I do feel that this is winning solution to the associate issue which is multiple years old. So I hope that someone will choose to implement it. |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
I’m requesting that this stay open (ie remove the stale label) since the proposed solution has the potential to close the multi year issue that is plaguing many business. |
Is your feature request related to a problem? Please describe.
Yes, this would give users a high quality mechanism to get around the 1 day off bug: #1018
Describe the solution you'd like
We we would add a third parameter to onChange which would enable users to produce a LocalDate (or PlainDate as the Temporal spec calls it) without having to do workarounds such as those described in #1018
For example, you could then use that
parts
object to do a high quality translation to LocalDate since you'd know that you can disregard hours and minutes:And of course you can still handle moments in time types too:
Describe alternatives you've considered
There are a great many workarounds listed in #1018 and none of them are considered to be universally successful or more superior to another. My approach described in https://dev.to/dgreene1/making-your-datepicker-easier-to-work-with-21n4 gets closer by using domain driven types (like the Temporal spec) to give more clarity. But that approach is also hamstrung by having to work on formatting the ISO string. So the approach above removes the JS Date object from the mix entirely and allows true representation of LocalDate (i.e. a date without time).
Additional context
offset
is something we need to support. Any thoughts? If this was approved I would only add offset if we were able to make sure it was the offset that the picker was using.The text was updated successfully, but these errors were encountered: