zoukankan      html  css  js  c++  java
  • react-native DatePicker --- 'react-native-datepicker' 小坑

    经常需要二级联动的日期上面, DatePicker在模拟器和真机上面有一点小差别,
    我们经常需要 截止时间不小于开始时间,在模拟器上,
    开始时间

    结束时间,但是结束时间可以比开始时间提前一天!

    在真机上测试时,就是正常的。
    <DatePicker
    style={{ pTd(130)}}
    date={this.state.createTimeStart}
    mode="date"
    placeholder="生产日期"
    format="YYYY-MM-DD"
    minDate="2016-05-01"
    maxDate="2040-06-01"
    confirmBtnText="Confirm"
    cancelBtnText="Cancel"
    customStyles={{
    dateIcon: {
    display: 'none'
    },
    dateInput: {
    height: pTd(32),
    // marginLeft: 36
    }
    // ... You can check the source to find the other keys.
    }}
    onDateChange={(date) => {
    this.setState({
    createTimeStart: date,
    createTimeEnd: date
    })
    }}
    />

    <DatePicker
    style={{ pTd(130)}}
    date={this.state.createTimeEnd}
    mode="date"
    placeholder="生产日期"
    format="YYYY-MM-DD"
    minDate={this.state.createTimeStart == "" ? "2016-05-01" : this.state.createTimeStart}
    maxDate="2040-06-01"
    confirmBtnText="Confirm"
    cancelBtnText="Cancel"
    customStyles={{
    dateIcon: {
    display: 'none'
    },
    dateInput: {
    height: pTd(32),
    // marginLeft: 36
    }
    // ... You can check the source to find the other keys.
    }}
    onDateChange={(date) => {
    this.setState({
    createTimeEnd: date,
    createTimeStart: this.state.createTimeStart == "" ? date : this.state.createTimeStart
    })
    }}
    />

  • 相关阅读:
    寒假学习进度九
    寒假学习进度八
    RestTemplate-记录
    Axure licensee key 8~9-转
    Mysql数据库引擎介绍--转载
    Mysql外键约束--转载
    IDEA快捷建使用
    MySQL在windows上多次安装失败
    五款优秀的端口扫描工具
    java 图片处理 base64编码和图片二进制编码相互转换-转载
  • 原文地址:https://www.cnblogs.com/xk-g/p/9593077.html
Copyright © 2011-2022 走看看