diff --git a/frontend/mgramseva/lib/utils/common_methods.dart b/frontend/mgramseva/lib/utils/common_methods.dart index 6964be456..4f671094c 100644 --- a/frontend/mgramseva/lib/utils/common_methods.dart +++ b/frontend/mgramseva/lib/utils/common_methods.dart @@ -170,7 +170,7 @@ class CommonMethods { {int monthCount=2,bool showCurrentMonth = false}) { var monthList = []; final currentTime = DateTime.now(); - DatePeriod newDT = DatePeriod(ytd.endDate.subtract(Duration(days: daysToSub(monthCount,currentTime.year))), ytd.endDate, DateType.MONTH); + DatePeriod newDT = DatePeriod(ytd.endDate.subtract(Duration(days: daysToSubtract(monthCount,currentTime.year,currentTime.month))), ytd.endDate, DateType.MONTH); if (currentTime.year < newDT.startDate.year) { return []; }