Skip to content
New issue

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

Fix: add locale to datepicker calendar for ios 14 and above #522

Conversation

jacqueslorentz
Copy link

@jacqueslorentz jacqueslorentz commented Oct 17, 2021

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:
Capture d’écran 2021-10-17 à 13 27 23

After modification:
Capture d’écran 2021-10-17 à 12 53 10

Compatibility

OS Implemented
iOS
Android

Checklist

  • I have tested this on a device and a simulator

I am waiting for any comment, any update I should made on thise PR.
Thanks for your work!

@ahzahri
Copy link

ahzahri commented Oct 18, 2021

We are going soon to production and we really need this fix.
Can someone look at this PR please ? Thank you.

@jacqueslorentz
Copy link
Author

We are going soon to production and we really need this fix. Can someone look at this PR please ? Thank you.

@ahzahri
If you really need this fix now and you use Yarn to manage your dependencies, you can add following lines to your package.json, it should work!

"resolutions": {
    "@react-native-community/datetimepicker": "jacqueslorentz/datetimepicker#fix/calendar-locale-ios-14+"
}

@ahzahri
Copy link

ahzahri commented Oct 19, 2021

@jacqueslorentz thank you ! I'll try to add the reference to your branch and do some more testing !!

@christophemenager
Copy link

Thank you so much for this PR !

@vonovak vonovak mentioned this pull request Dec 11, 2021
5 tasks
@vonovak vonovak closed this in #540 Dec 11, 2021
@vonovak
Copy link
Member

vonovak commented Dec 11, 2021

🎉 This issue has been resolved in version 5.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants