pGetDateTimeCustomFormat static method
Formats dateTime with a custom format.
Implementation
static String pGetDateTimeCustomFormat(DateTime? dateTime, String format,
{String? defaultValue, String? localization}) {
if (dateTime == null) return defaultValue ?? '';
try {
final locale = localization ?? 'en';
return DateFormat(format, locale).format(dateTime);
} catch (e) {
if (kDebugMode) print('pGetDateTimeCustomFormat error: $e');
return defaultValue ?? '00-00-0000';
}
}