Skip to content

Instantly share code, notes, and snippets.

@otiai10
Last active May 30, 2016 16:29
Show Gist options
  • Select an option

  • Save otiai10/22765e1ede76f81da1814de7e9322f03 to your computer and use it in GitHub Desktop.

Select an option

Save otiai10/22765e1ede76f81da1814de7e9322f03 to your computer and use it in GitHub Desktop.
diff --git a/Libraries/Components/DatePicker/DatePickerIOS.ios.js b/Libraries/Components/DatePicker/DatePickerIOS.ios.js
index 49df159..2174f4b 100644
--- a/Libraries/Components/DatePicker/DatePickerIOS.ios.js
+++ b/Libraries/Components/DatePicker/DatePickerIOS.ios.js
@@ -46,7 +46,7 @@ var DatePickerIOS = React.createClass({
/**
* The currently selected date.
*/
- date: PropTypes.instanceOf(Date).isRequired,
+ date: PropTypes.number.isRequired,
/**
* Date change handler.
@@ -108,7 +108,7 @@ var DatePickerIOS = React.createClass({
// prop. That way they can also disallow/undo/mutate the selection of
// certain values. In other words, the embedder of this component should
// be the source of truth, not the native component.
- var propsTimeStamp = this.props.date.getTime();
+ var propsTimeStamp = this.props.date; //.getTime();
if (this._picker && nativeTimeStamp !== propsTimeStamp) {
this._picker.setNativeProps({
date: propsTimeStamp,
@@ -123,7 +123,7 @@ var DatePickerIOS = React.createClass({
<RCTDatePickerIOS
ref={ picker => this._picker = picker }
style={styles.datePickerIOS}
- date={props.date.getTime()}
+ date={props.date}
maximumDate={
props.maximumDate ? props.maximumDate.getTime() : undefined
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment