Remove TimePicker state and Moment dependency#25471
Remove TimePicker state and Moment dependency#25471pablinos wants to merge 33 commits intoWordPress:update/post-schedule-switch-calendar-componentfrom
Conversation
There was a problem hiding this comment.
I'm not sure this default is needed, as it's initialised elsewhere, and should probably be handled by default props instead. This is a reminder to me to remove it!
418b6de to
7ef881a
Compare
|
I'm getting a problem when this is used with our version of the |
There was a problem hiding this comment.
| import startOfMinute from 'date-fns/startOfMinute'; | |
| import set from 'date-fns/set'; | |
| import format from 'date-fns/format'; | |
| import { format, set, startOfMinute } from 'date-fns'; |
There was a problem hiding this comment.
| function IntegerValidatedField( { as, value, onUpdate, ...props } ) { | |
| const element = as ?? 'input'; | |
| function IntegerValidatedField( { as = 'input', value, onUpdate, ...props } ) { | |
| const element = as; |
5561271 to
36bf38c
Compare
When using `defaultValue` the change to the DOM node meant that focus was being lost as the `TimePicker` was rendered.
15c5191 to
b757a45
Compare
3234078 to
58bf061
Compare
|
I'd wager that all the problems this PR intended to address are since resolved and the last push here is going to be three years old soon. We should close this one out, no? |
Yes we should! |
Description
While working on the post schedule feature, @retrofox and I noticed that there are a number of bugs with the implementation of the
DateTimePicker. TheTimePickerwas holding its own local state, and would only update the month when the select component lost focus.This change updates the
TimePickercomponent to:date-fnsrather than MomentonChangecallback.How has this been tested?
Locally using Storybook
Screenshots
Types of changes
This could be a breaking change, depending on how others are using the
TimePickercomponent.Checklist: