ZonedDateFormatter.locationWithProvider constructor
- DataProvider provider,
- Locale locale,
- DateFormatter formatter
Creates a zoned formatter based on a non-zoned formatter.
Caution: The locale provided here must match the locale used to construct the non-zoned formatter, or else unexpected behavior may occur!
See the Rust documentation for Location
for more information.
Throws DateTimeFormatterLoadError on failure.
Implementation
factory ZonedDateFormatter.locationWithProvider(DataProvider provider, Locale locale, DateFormatter formatter) {
final result = _icu4x_ZonedDateFormatter_create_location_with_provider_mv1(provider._ffi, locale._ffi, formatter._ffi);
if (!result.isOk) {
throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
}
return ZonedDateFormatter._fromFfi(result.union.ok, []);
}