formatSimpleDateTime function
Implementation
String formatSimpleDateTime(DateTime date) {
final now = DateTime.now();
if (now.year != date.year) {
return DateFormat("yyyy년 M월 d일").format(date);
}
if (now.month != date.month || now.day != date.day) {
return DateFormat("M월 d일").format(date);
}
return DateFormat(
"a h:mm",
).format(date).replaceAll('PM', '오후').replaceAll('AM', '오전');
}