We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
The problem that about props can be solved, with code which is below;
src/TimePicker.js add.
static getDerivedStateFromProps(nextProps, current_state) { if (nextProps.initDate != current_state.selectedDate) { const getInfo = self.update(nextProps); return getInfo; } return null; } update(props) { const {initDate, format24, minutes} = props; const selectedDate = initDate ? new Date(initDate) : new Date(); const time12format = hourTo12Format(selectedDate.getHours()); const time24format = selectedDate.getHours(); const hours = self.props.hours || getHoursArray(format24); const selectedHourIndex = format24 ? time24format : Number(time12format[0]) - 1; const minutesCount = minutes ? minutes.length : 12; const selectedMinuteIndex = Math.round( selectedDate.getMinutes() / (HOUR / minutesCount), ); const selectedAmIndex = time12format[1] === AM ? 0 : 1; return {selectedDate, selectedHourIndex, selectedMinuteIndex, selectedAmIndex}; }
The text was updated successfully, but these errors were encountered:
it breaks everything....
Sorry, something went wrong.
No branches or pull requests
Hi,
The problem that about props can be solved, with code which is below;
src/TimePicker.js add.
The text was updated successfully, but these errors were encountered: