Remove obsolete props being passed through to DatePicker component #11649
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The
<DateTimePicker/>
component (and documentation) describes passing throughlocale
andis12Hour
props through to the<DatePicker />
component. However,<DatePicker />
does not implement (nor pass through) either of those props. Further,locale
is not used anywhere.I'm guessing these are carryovers from before the Date picker refactor.
I think
locale
is no longer needed becausereact-dates
(which<DatePicker/>
has as a dependent) usesmoment.locale()
for its localization andwp.date
initializes moment with the locale via embedded server inline script. However, while this pull doesn't address this, I think this may be something needing addressed at some point because:moment.locale
fails to be initialized (or moment gets dropped as the date library used bywp.date
) then the date-picker will not be localized (and it won't be readily apparent).react-dates
has some user interface strings that don't appear to be localized at all. I'm not sure if this is a biggy because I don't know if we have it configured so any of those strings are shown. If however they are or do get used, they should probably be localized.DateTime
does not pass through any props to the underlyingreact-dates
component. It may have been intentional to not expose additional props controlling it to parent components, but in case it wasn't intentional we may want to consider doing so.How has this been tested?
Types of changes
This has minimal impact because the props removed were not being used.
Checklist: