Browse Source

Bugfix: Allow no maximum and minimum date

master
Henning Hall 6 years ago
parent
commit
6e8e4fb098
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      DatePickerAndroid.js

+ 5
- 5
DatePickerAndroid.js View File

@ -30,10 +30,10 @@ class DatePickerAndroid extends React.Component {
this.props.onDateChange(jsDate) this.props.onDateChange(jsDate)
} }
_maximumDate = () => this._toIsoWithTimeZoneOffset(this.props.maximumDate);
_minimumDate = () => this._toIsoWithTimeZoneOffset(this.props.minimumDate);
_maximumDate = () => this.props.minimumDate && this._toIsoWithTimeZoneOffset(this.props.maximumDate);
_minimumDate = () => this.props.minimumDate && this._toIsoWithTimeZoneOffset(this.props.minimumDate);
_date = () => this._toIsoWithTimeZoneOffset(this.props.date); _date = () => this._toIsoWithTimeZoneOffset(this.props.date);
_fromIsoWithTimeZoneOffset = date => { _fromIsoWithTimeZoneOffset = date => {
@ -42,7 +42,7 @@ class DatePickerAndroid extends React.Component {
return moment.utc(date).subtract(this.props.timeZoneOffsetInMinutes, 'minutes') return moment.utc(date).subtract(this.props.timeZoneOffsetInMinutes, 'minutes')
} }
_toIsoWithTimeZoneOffset = date => { _toIsoWithTimeZoneOffset = date => {
if (this.props.timeZoneOffsetInMinutes === undefined) if (this.props.timeZoneOffsetInMinutes === undefined)
return moment(date).toISOString() return moment(date).toISOString()

Loading…
Cancel
Save