Fix: add locale to datepicker calendar for ios 14 and above #522
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.
Summary
I found a way to fix the datepicker's calendar locale on days name for iOS 14 and above. Issue #300
Based on this stackoverflow article and after some researches, nobody are able to set this locale in Objective-C. So I implemented a Swift wrapper for this configuration.
I needed to update project's configuration settings to build the Swift code.
I also update the example project to run with latest Xcode/iOS versions (pods upgrade and minimum target set to iOS 10.0)
These modification impact only the binding between react-native and the objective-c/swift code for the iOS platform.
Test Plan
I have no clue how to unit test these modifications...
The fonctionnality can be manually test by launching the example project on iOS (14 or above) and add the
locale
props to the<DateTimePicker />
.Example
With adding
locale={'fr-FR'}
to the<DateTimePicker />
in the example project:Before modification:
After modification:
Compatibility
Checklist
I am waiting for any comment, any update I should made on thise PR.
Thanks for your work!