format method

String format(
  1. ILibDate date
)

Format date according to this formatter's settings and return the resulting string. date may be any ILibDate, including an ILibDateOptions describing the date to format.

Implementation

String format(ILibDate date) {
  ILibDate resolved = date;
  bool instantResolved = false;
  if (date is ILibDateOptions) {
    final (ILibDate r, bool utcConverted) = _resolveDateOptions(date);
    instantResolved = utcConverted;
    resolved = r;
  }
  resolved =
      _convertToFormatterCalendar(resolved, instantResolved: instantResolved);
  return _formatTemplate(resolved, _templateArr);
}