初始化
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
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!);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user