Skip to content

Commit 6637c03

Browse files
authored
feat: remove locale prop (#540)
BREAKING CHANGE: locale prop removed
1 parent ecf8f26 commit 6637c03

File tree

5 files changed

+8
-22
lines changed

5 files changed

+8
-22
lines changed

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ React Native date & time picker component for iOS, Android and Windows.
6767
- [`firstDayOfWeek` (`optional`, `Windows only`)](#firstDayOfWeek-optional-windows-only)
6868
- [`textColor` (`optional`, `iOS only`)](#textColor-optional-ios-only)
6969
- [`themeVariant` (`optional`, `iOS only`)](#themeVariant-optional-ios-only)
70-
- [`locale` (`optional`, `iOS only`)](#locale-optional-ios-only)
7170
- [`is24Hour` (`optional`, `Windows and Android only`)](#is24hour-optional-windows-and-android-only)
7271
- [`neutralButtonLabel` (`optional`, `Android only`)](#neutralbuttonlabel-optional-android-only)
7372
- [`minuteInterval` (`optional`)](#minuteinterval-optional)
@@ -177,6 +176,14 @@ export const App = () => {
177176
};
178177
```
179178

179+
## Locale note
180+
181+
On Android, the picker will be controlled by the system locale. If you wish to change it, [see instructions here](https://stackoverflow.com/a/2900144/2070942).
182+
183+
On iOS, the locale can be controlled from xCode, as [documented here](https://developer.apple.com/documentation/xcode/adding-support-for-languages-and-regions).
184+
185+
For Expo, follow the [localization docs](https://docs.expo.dev/distribution/app-stores/#localizing-your-ios-app).
186+
180187
## Props
181188

182189
> Please note that this library currently exposes functionality from [`UIDatePicker`](https://developer.apple.com/documentation/uikit/uidatepicker?language=objc) on iOS and [DatePickerDialog](https://developer.android.com/reference/android/app/DatePickerDialog) + [TimePickerDialog](https://developer.android.com/reference/android/app/TimePickerDialog) on Android, and [`CalendarDatePicker`](https://docs.microsoft.com/en-us/windows/uwp/design/controls-and-patterns/calendar-date-picker) +[TimePicker](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.timepicker?view=winrt-19041) on Windows.
@@ -310,14 +317,6 @@ Allows changing of the textColor of the date picker. Has effect only when `displ
310317
<RNDateTimePicker textColor="red" />
311318
```
312319

313-
#### `locale` (`optional`, `iOS only`)
314-
315-
Allows changing of the locale of the component. By default it uses the device's locale.
316-
317-
```js
318-
<RNDateTimePicker locale="es-ES" />
319-
```
320-
321320
#### `is24Hour` (`optional`, `Windows and Android only`)
322321

323322
Allows changing of the time picker to a 24 hour format. By default, this value is decided automatcially based on the user's chosen locale and other preferences.

ios/RNDateTimePickerManager.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ + (NSString*) datepickerStyleToString: (UIDatePickerStyle) style API_AVAILABLE(
9797
}
9898

9999
RCT_EXPORT_VIEW_PROPERTY(date, NSDate)
100-
RCT_EXPORT_VIEW_PROPERTY(locale, NSLocale)
101100
RCT_EXPORT_VIEW_PROPERTY(minimumDate, NSDate)
102101
RCT_EXPORT_VIEW_PROPERTY(maximumDate, NSDate)
103102
RCT_EXPORT_VIEW_PROPERTY(minuteInterval, NSInteger)

src/datetimepicker.ios.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ const getDisplaySafe = (display: IOSDisplay): IOSDisplay => {
4343

4444
export default function Picker({
4545
value,
46-
locale,
4746
maximumDate,
4847
minimumDate,
4948
style,
@@ -116,7 +115,6 @@ export default function Picker({
116115
ref={_picker}
117116
style={StyleSheet.compose(heightStyle, style)}
118117
date={dates.value}
119-
locale={locale !== null && locale !== '' ? locale : undefined}
120118
maximumDate={dates.maximumDate}
121119
minimumDate={dates.minimumDate}
122120
mode={mode}

src/index.d.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,6 @@ export type IOSNativeProps = Readonly<
6767
BaseProps & {
6868
date?: Date;
6969

70-
/**
71-
* The date picker locale.
72-
*/
73-
locale?: string;
74-
7570
/**
7671
* The interval at which minutes can be selected.
7772
*/

src/types.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,6 @@ export type IOSNativeProps = $ReadOnly<{|
8888
...BaseProps,
8989
date?: ?Date,
9090

91-
/**
92-
* The date picker locale.
93-
*/
94-
locale?: ?string,
95-
9691
/**
9792
* The interval at which minutes can be selected.
9893
*/

0 commit comments

Comments
 (0)