getFormattedEarthDate static method

String getFormattedEarthDate(
  1. DateTime earthDate
)

Returns the formatted Earth date as a string given a DateTime earthDate

Implementation

static String getFormattedEarthDate(DateTime earthDate) {
  // Formatting the day
  String day = earthDate.day.toString().padLeft(2, '0');

  // Getting the month name
  String month = months[earthDate.month - 1];

  // Getting the year
  String year = earthDate.year.toString();

  return '$day $month $year';
}