startAndEndDateOfMonth static method

DateValue startAndEndDateOfMonth({
  1. String? date,
})

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),
    ),
  );
}