React native React native date picker在选择日期时显示上一个日期

React native React native date picker在选择日期时显示上一个日期,react-native,datepicker,React Native,Datepicker,我正在使用React原生日期选择器,它显示falsy日期。如果我选择2017年1月2日。预计价值为2017年1月1日 <DatePicker date={displayDate} mode="date" minDate={"1970/01/01"} androidMode="spinner" format="dddd MM/DD/YYYY" confirmBtnText="Confirm" cancelBtnText="Cancel" showIcon={f

我正在使用React原生日期选择器,它显示falsy日期。如果我选择2017年1月2日。预计价值为2017年1月1日

<DatePicker
  date={displayDate}
  mode="date"
  minDate={"1970/01/01"}
  androidMode="spinner"
  format="dddd MM/DD/YYYY"
  confirmBtnText="Confirm"
  cancelBtnText="Cancel"
  showIcon={false}
  onDateChange={(date) => {
    let dateTime, time, newDate;
    newDate = dateFormatter.getDateOnlyByUserTimeZone(date, this.props.user.timeZone)
    time = dateFormatter.getLTZTimeOnlyFromUTC(this.props.caseCopy.caseDate, this.props.user.timeZone)
    this.onChangeCaseDateTime(newDate, time)
  }}
/>
{
让dateTime,time,newDate;
newDate=dateFormatter.GetDateOnlyBySerTimeZone(日期,this.props.user.timeZone)
time=dateFormatter.getLTZTimeOnlyFromUTC(this.props.caseCopy.caseDate,this.props.user.timeZone)
this.onChangeCaseDateTime(newDate,time)
}}
/>

有人能提出可能的解决办法吗?

可能与时区有关。但是我们缺少一些信息。displayDate来自哪里?onChangeCaseDateTime做什么。。。你能创建一个工作示例吗?像snack.expo.io,我们可以试试。react native没有名为
DatePicker
的组件,您使用的是
DatePickerIOS
还是第三方库?可能与时区有关。但是我们缺少一些信息。displayDate来自哪里?onChangeCaseDateTime做什么。。。你能创建一个工作示例吗?像snack.expo.io一样,我们可以试试。react native没有名为
DatePicker
的组件,您使用的是
DatePickerIOS
还是第三方库?