DateFormatterGregorian.mde constructor
- Locale locale, {
- DateTimeLength? length,
- DateTimeAlignment? alignment,
See the Rust documentation for try_new
for more information.
See the Rust documentation for MDE
for more information.
Throws DateTimeFormatterLoadError on failure.
Implementation
factory DateFormatterGregorian.mde(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
final result = _icu4x_DateFormatterGregorian_create_mde_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
if (!result.isOk) {
throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
return DateFormatterGregorian._fromFfi(result.union.ok, []);
}