Closed matthiasnunn closed 2 months ago
Describe the bug March 2024 has only 30 days instead of 31 days in DatePicker.
DatePicker
To Reproduce See the demo page:
Additional context The problem occurs in the method _getDaysInMonth in the file date_picker.dart:
_getDaysInMonth
date_picker.dart
return DateTimeRange( start: DateTime(year, month), end: DateTime(year, month + 1), ).duration.inDays;
Reproducing it for March 2024 it returns 30:
30
return DateTimeRange( start: DateTime(2024, 3), end: DateTime(2024, 3 + 1), ).duration.inDays;
But using DateTime.utc returns correctly 31:
DateTime.utc
31
return DateTimeRange( start: DateTime.utc(2024, 3), end: DateTime.utc(2024, 3 + 1), ).duration.inDays;
Describe the bug March 2024 has only 30 days instead of 31 days in
DatePicker
.To Reproduce See the demo page:
Additional context The problem occurs in the method
_getDaysInMonth
in the filedate_picker.dart
:Reproducing it for March 2024 it returns
30
:But using
DateTime.utc
returns correctly31
: