【发布时间】:2019-11-11 17:09:05
【问题描述】:
我使用 Flutter 的日历在我的应用中选择一个日期,但我确保将其限制为仅当月。我这样做是通过设置:
- firstDate:开始时间(例如,2019 年 6 月 1 日,
- lastDate:beginningOfNextMonth(例如,2019 年 7 月 1 日),
- 初始日期:DateTime.now()
现在是月底(撰写本文时的 6 月 30 日),我收到了一个 AssertionError 说 initialDate must be on or before lastDate。所以我打印了(最好的调试器!)我的日期,我得到了:
initialDate: 2019-06-30 20:07:25endOfMonth: 2019-07-01 00:00:00
正如我所料。但是当我比较两者时,我得到initialDate.isBefore (endOfMonth) == false)。
这只是我的一些人为错误,还是我必须联系 Flutter 团队?
【问题讨论】:
标签: datetime flutter dart datetimepicker