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
Refactor DatePicker- and TimePicker-component #3941
Conversation
01a13d0
to
df9a298
Compare
b59599d
to
aee0d4f
Compare
7b1b5ab
to
992cc72
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks solid, and the component looks nicer!
But I do like when the end time automatically updates after changing the start time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent rewrite, yet the feature moving the end time forward will be sorely missed. Is it not possible to make this work with functional components?
I'd like to add that we should extend the date picker to have a range functionality. Like this: https://ui.shadcn.com/docs/components/date-picker#date-range-picker |
@eikhr What's the status on this? I see there are some unresolved questions. |
Yep, I am going to add back the functionality for automatically moving end date forwards. Just haven't gotten around to it yet. |
992cc72
to
195fef6
Compare
f6997cf
to
f18222d
Compare
End-time is moved to the whole hour between 1 and 2 hours after the start-time, after the startTime field is blurred (deselected).
f18222d
to
fd78baf
Compare
Description
Small refactor of the DatePicker thingy. Shouldn't change too much, but rewrote to functional components and simplified the logic a bit. ~100 fewer lines of code:)
Result
Some minor changes in appearance:
I have changed the behaviour slightly to simplify the logic. In the meeting editor we would previously automatically move the end time forward if it was set before the start time, but this didn't play well with the simplified component. Now it will simply show a form validation error (which is how it works in f.ex. the event-editor).The end-time auto-moving is kept intact! It now moved the end time to ~two hours after the start time when blurring (deselecting) the start time field.
Testing
I've gone through every usage of the component in the webapp, and checked manually that it still works as expected.