pDateToString static method

String pDateToString(
  1. DateTime? dateTime, {
  2. String? defaultValue,
  3. String? localization,
})

Implementation

static String pDateToString(DateTime? dateTime,
    {String? defaultValue, String? localization}) {
  try {
    if (dateTime == null) {
      return defaultValue ?? '';
    }
    String formatted =
        pDateFormatter(localization: localization).format(dateTime);
    return formatted;
  } catch (e) {
    return '00-00-0000';
  }
}