DateFormatter.e constructor

DateFormatter.e(
  1. Locale locale, [
  2. DateTimeLength? length
])

See the Rust documentation for try_new for more information.

See the Rust documentation for E for more information.

Additional information: 1

Throws DateTimeFormatterLoadError on failure.

Implementation

factory DateFormatter.e(Locale locale, [DateTimeLength? length]) {
  final result = _icu4x_DateFormatter_create_e_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err());
  if (!result.isOk) {
    throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
  }
  return DateFormatter._fromFfi(result.union.ok, []);
}