startAndEndDateOfMonth static method
start and end date of month by date
Implementation
static DateValue startAndEndDateOfMonth({String? date}) {
DateTime dateTime = (date != null)
? stringToDateTime(date: date)
: DateTime.now();
return DateValue(
startDate: dateTimeToString(
date: DateTime(dateTime.year, dateTime.month, 1),
),
endDate: dateTimeToString(
date: DateTime(dateTime.year, dateTime.month + 1, 0),
),
);
}