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
    })
    }}
    />

  • 相关阅读:
    [转载]为 Windows 下的 PHP 安装 PEAR 和 PHPUnit
    作品和案例
    js创建对象的最佳实践
    log4j的PatternLayout参数含义
    Java线程池——ThreadPoolExecutor的使用
    登录mysql 报 Access denied for user 'root'@'localhost' 错误
    CentOS 7下使用yum安装MySQL5.7
    linux下MySQL停止和重启
    Linux 命令 -- chown
    Linux 命令 -- chmod
  • 原文地址:https://www.cnblogs.com/xk-g/p/9593077.html
Copyright © 2011-2022 走看看