formatDateMonthAndYear static method

String formatDateMonthAndYear(
  1. DateTime? date
)

Formats a nullable DateTime into 'MMM d, y' format and converts to uppercase. Returns an empty string if the date is null or on error.

Implementation

static String formatDateMonthAndYear(DateTime? date) {
  try {
    return DateFormat.yMMMd().format(date!).toUpperCase();
  } catch (e) {
    return '';
  }
}