14 lines
380 B
Dart
14 lines
380 B
Dart
import 'package:intl/intl.dart';
|
|
|
|
extension DateTimeNullableX on DateTime? {
|
|
String yyyyMMDDFormat({String gap = "-"}) {
|
|
if (this == null) return "";
|
|
return DateFormat("yyyy${gap}MM${gap}dd HH:mm:ss").format(this!);
|
|
}
|
|
|
|
String ymdSMFormat({String gap = "-"}) {
|
|
if (this == null) return "";
|
|
return DateFormat("yyyy${gap}MM${gap}dd HH:mm").format(this!);
|
|
}
|
|
}
|