设备 预约接口
This commit is contained in:
@@ -418,11 +418,22 @@ String time_08_Formatter(String time) {
|
||||
.format(DateTime.parse(time).toLocal());
|
||||
}
|
||||
|
||||
String time_08_Formatter_pattern(String time, String pattern) {
|
||||
if (time == null || time == "") {
|
||||
return "";
|
||||
// String time_08_Formatter_pattern(String time, String pattern) {
|
||||
// if (time == null || time == "") {
|
||||
// return "";
|
||||
// }
|
||||
// return DateFormat(pattern).format(DateTime.parse(time).toLocal());
|
||||
// }
|
||||
|
||||
String time_08_Formatter_pattern(dynamic date, String pattern) {
|
||||
if (date == null || date.toString().isEmpty) return "-";
|
||||
try {
|
||||
String normalized = date.toString().replaceAll("/", "-");
|
||||
DateTime dt = DateTime.parse(normalized);
|
||||
return DateFormat(pattern).format(dt);
|
||||
} catch (e) {
|
||||
return "-";
|
||||
}
|
||||
return DateFormat(pattern).format(DateTime.parse(time).toLocal());
|
||||
}
|
||||
|
||||
enum LoadingDialogIcon { ble, wifi, none }
|
||||
|
||||
Reference in New Issue
Block a user