formatDateStr static method

String? formatDateStr(
  1. String dateStr, {
  2. bool? isUtc,
  3. String format = DateFormats.full,
})

格式化 日期 by 字符串 dateStr 日期字符串

Implementation

static String? formatDateStr(String dateStr,
    {bool? isUtc, String format = DateFormats.full}) {
  final dateTime = getDateTime(dateStr, isUtc: isUtc);
  if (dateTime != null) {
    return formatDate(dateTime, format: format);
  } else {
    return null;
  }
}