-
Notifications
You must be signed in to change notification settings - Fork 17
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
enhancement: Datepicker: Support dynamic range #375
enhancement: Datepicker: Support dynamic range #375
Conversation
@lukebp ready for review |
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.
ACK.
Left some minors.
@@ -195,7 +198,6 @@ const DatePicker = ({ | |||
}, | |||
[setLabelMonthsState, labelMonthsState] | |||
); | |||
|
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.
re-add
@@ -40,6 +40,9 @@ const DatePicker = ({ | |||
}) => { | |||
const { themeName } = useTheme(); | |||
const yearArr = useMemo(() => getYearArray(years), [years]); | |||
useEffect(() => { |
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.
make the useEffect a named function with a meaningful name describing
what the useEffect does, i'd add a comment as well.
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.
Because inside the useEffect function has only 1 line of code. So I think would add comment is enough
Needs approval from @tiagoalvesdulce. |
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.
LGTM
Closes #342
This diff makes the Datepicker change the range picker if the input of
the range is changed programly.
The video show the example of preview is below. In the video the max
date is increased 1 day every 5s
vokoscreen-2021-11-03_15-05-59.mp4