transform method

String? transform(
  1. dynamic value, [
  2. String pattern = 'mediumDate'
])

Implementation

String? transform(dynamic value, [String pattern = 'mediumDate']) {
  if (value == null) return null;
  if (!supports(value)) {
    throw InvalidPipeArgumentException(DatePipe, value);
  }
  if (value is num) {
    value = DateTime.fromMillisecondsSinceEpoch(unsafeCast(value));
  }
  if (DatePipe._aliases.containsKey(pattern)) {
    pattern = DatePipe._aliases[pattern]!;
  }
  return _formatDate(unsafeCast(value), Intl.defaultLocale, pattern);
}