浏览代码

date picker fix

/main
xingwei.zhu 5 年前
当前提交
dcb906a8
共有 1 个文件被更改,包括 2 次插入8 次删除
  1. 10
      Runtime/material/date_picker.cs

10
Runtime/material/date_picker.cs


void _updateCurrentDate() {
this._todayDate = DateTime.Now;
DateTime tomorrow = new DateTime(this._todayDate.Year, this._todayDate.Month, this._todayDate.Day + 1);
DateTime tomorrow = this._todayDate.AddDays(1);
TimeSpan timeUntilTomorrow = tomorrow.TimeOfDay - this._todayDate.TimeOfDay;
this._timer?.cancel();
this._timer = Window.instance.run(timeUntilTomorrow,

}
DateTime _addMonthsToMonthDate(DateTime monthDate, int monthsToAdd) {
if (monthsToAdd < 0) {
var monthsToAddAfterMod = monthsToAdd % 12 + 12;
return new DateTime(monthDate.Year + (monthsToAdd / 12), monthDate.Month + monthsToAddAfterMod, 1);
}
else {
return new DateTime(monthDate.Year + (monthsToAdd / 12), monthDate.Month + monthsToAdd % 12, 1);
}
return monthDate.AddMonths(monthsToAdd);
}
Widget _buildItems(BuildContext context, int index) {

正在加载...
取消
保存