timeDate1Format static method
Implementation
static timeDate1Format({String? date, String? locale}) {
try {
if (date?.isNotEmpty == true) {
var time = date?.split("+");
initializeDateFormatting(locale ?? "vi_VN");
var inputFormat =
DateFormat("yyyy-MM-dd'T'HH:mm:ss", locale ?? "vi_VN");
var inputDate = inputFormat.parse(time![0]);
var outputFormat = DateFormat('dd/MM/yyyy, hh:mm a', locale ?? "vi_VN");
var outputDate = outputFormat.format(inputDate);
return outputDate.toUpperCase();
} else {
return "unknown";
}
} catch (e) {
return "format error";
}
}