Get the first day of the month for a given date
static DateTime getFirstDayOfMonth(DateTime date) { return DateTime(date.year, date.month, 1); }