Skip to content

Commit

Permalink
fix: prevent unrecognized selector setHighlightsToday on iOS 14 (#249)
Browse files Browse the repository at this point in the history
* fix: prevent unrecognized selector setHighlightsToday on iOS 14

* improve docs
  • Loading branch information
vonovak authored Aug 18, 2020
1 parent a809783 commit b8048c0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

### Changelog is no longer maintained

Please see the [releases page](https://github.com/react-native-community/datetimepicker/releases)

### 2.6.0

- Add time picker for Windows [#206](https://github.com/react-native-community/datetimepicker/pull/206)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ Indicates which day is shown as the first day of the week.

#### `textColor` (`optional`, `iOS only`)

Allows changing of the textColor of the date picker.
Allows changing of the textColor of the date picker. Has effect only when `display` is `"spinner"`.

```js
<RNDateTimePicker textColor="red" />
Expand Down
4 changes: 4 additions & 0 deletions ios/RNDateTimePickerManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ + (NSString*) datepickerStyleToString: (UIDatePickerStyle) style {

RCT_CUSTOM_VIEW_PROPERTY(textColor, UIColor, RNDateTimePicker)
{
if (@available(iOS 14.0, *) && view.datePickerStyle != UIDatePickerStyleWheels) {
// prevents #247
return;
}
if (json) {
[view setValue:[RCTConvert UIColor:json] forKey:@"textColor"];
[view setValue:@(NO) forKey:@"highlightsToday"];
Expand Down

0 comments on commit b8048c0

Please sign in to comment.