You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
I'm showing the time with 'showTimeSelect'.
What should I do if I only have logic that I want to run when I choose a time?
What I found is to use the second parameter of onChange. Date has a second parameter and time has no second parameter.
Is this the right way?
Please let me know if there's any other way 🙏
<DatePickershowTimeSelect={true}selected={dateTime}onChange={(date,event)=>{if(event){// Logic to run when selecting a date}else{// Logic to run when selecting a time}}}/>
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello!
I'm showing the time with 'showTimeSelect'.
What should I do if I only have logic that I want to run when I choose a time?
What I found is to use the second parameter of onChange. Date has a second parameter and time has no second parameter.
Is this the right way?
Please let me know if there's any other way 🙏
Beta Was this translation helpful? Give feedback.
All reactions