react-native - React Native 如何获取当前月份的第一个和最后一个日期到 DatePicker
问题描述
如何在 React Native 中获取当前月份的第一天和最后一天到我的 DatePicker
constructor(props){
super(props)
this.state={
modalVisible: false,
date:new Date(),
minfecha: '',
maxfecha: '',
isLoading: false,
},
this.setState({
minfecha: new Date(this.state.date.getFullYear(), this.state.date.getMonth(), 1),
maxfecha: new Date(this.state.date.getFullYear(), this.state.date.getMonth() + 1, 0)
});
}
解决方案
推荐阅读
- python - 在 Python 中出现错误:“IndexError:列表索引超出范围”
- javascript - multer npm:TypeError:无法读取未定义的属性“路径”
- python - 按钮的矩形在错误的位置
- php - 单独获取从现在到 30 天前几天的 SQL 数据
- swift - 无法在 SwiftUI Xcode 12 中使用 Stepper
- c++ - 将浮点数与字符串连接并舍入到小数点后 2 位
- html - 路径上的文本,ViewBox 裁剪字母
- chakra - 是否可以修改 Chakra UI 的 rem 大小?
- python - Python Tkinter - 用函数外的熊猫读取函数内的值
- php - 坚持如何修复 RegExpression 以将电子邮件解析为名称和地址