Skip to content

Commit

Permalink
修复定位到最后一个月时,无法定位问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaikai committed Jan 9, 2025
1 parent b7b06da commit 7db9d66
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ class TDCalendarBody extends StatelessWidget {
return;
}
final scrollDate = value!.reduce((a, b) => a.isBefore(b) ? a : b);
if (months.first.isAfter(scrollDate) || months.last.isBefore(scrollDate)) {
var lastMonthDay = DateTime(months.last.year, months.last.month + 1);
lastMonthDay = lastMonthDay.add(const Duration(days: -1));
if (months.first.isAfter(scrollDate) || lastMonthDay.isBefore(scrollDate)) {
return;
}
WidgetsBinding.instance.addPostFrameCallback((_) {
Expand Down

0 comments on commit 7db9d66

Please sign in to comment.