diff --git a/lib/src/month_view/month_view.dart b/lib/src/month_view/month_view.dart index 3a080aa8..defe5a21 100644 --- a/lib/src/month_view/month_view.dart +++ b/lib/src/month_view/month_view.dart @@ -400,7 +400,6 @@ class MonthViewState extends State> { _currentDate = DateTime( _currentDate.year, _currentDate.month + (value - _currentIndex), - _currentDate.day, ); _currentIndex = value; }); @@ -517,8 +516,7 @@ class MonthViewState extends State> { } /// Returns the current visible date in month view. - DateTime get currentDate => - DateTime(_currentDate.year, _currentDate.month, _currentDate.day); + DateTime get currentDate => DateTime(_currentDate.year, _currentDate.month); } /// A single month page. diff --git a/lib/src/week_view/week_view.dart b/lib/src/week_view/week_view.dart index 3225a1e2..78912306 100644 --- a/lib/src/week_view/week_view.dart +++ b/lib/src/week_view/week_view.dart @@ -474,7 +474,8 @@ class WeekViewState extends State> { "Provided minimum date: $_minDate, maximum date: $_maxDate", ); - _totalWeeks = _minDate.getWeekDifference(_maxDate) + 1; + _totalWeeks = + _minDate.getWeekDifference(_maxDate, start: widget.startDay) + 1; } /// Default builder for week line. @@ -621,7 +622,8 @@ class WeekViewState extends State> { if (week.isBefore(_minDate) || week.isAfter(_maxDate)) { throw "Invalid date selected."; } - _pageController.jumpToPage(_minDate.getWeekDifference(week)); + _pageController + .jumpToPage(_minDate.getWeekDifference(week, start: widget.startDay)); } /// Animate to page which gives day calendar for [week]. @@ -635,7 +637,7 @@ class WeekViewState extends State> { throw "Invalid date selected."; } await _pageController.animateToPage( - _minDate.getWeekDifference(week), + _minDate.getWeekDifference(week, start: widget.startDay), duration: duration ?? widget.pageTransitionDuration, curve: curve ?? widget.pageTransitionCurve, );