Struct DateTimeFormat
#[repr(transparent)]
pub struct DateTimeFormat { /* private fields */ }
The Intl.DateTimeFormat object is a constructor for objects
that enable language-sensitive date and time formatting.
Implementations
impl DateTimeFormat
fn new(locales: &Array, options: &Object) -> DateTimeFormatThe
Intl.DateTimeFormatobject is a constructor for objects that enable language-sensitive date and time formatting.
impl DateTimeFormat
fn format_range_to_parts(&self, start_date: &Date, end_date: &Date) -> Result<Array<DateTimeRangeFormatPart>, JsValue>The
Intl.DateTimeFormat.prototype.formatRangeToParts()method returns an array of locale-specific tokens representing each part of the formatted date range produced byIntl.DateTimeFormatformatters.Throws a
TypeErrorif the dates are invalid.
impl DateTimeFormat
fn format(&self) -> FunctionThe Intl.DateTimeFormat.prototype.format property returns a getter function that formats a date according to the locale and formatting options of this Intl.DateTimeFormat object.
impl DateTimeFormat
fn format_to_parts(&self, date: &Date) -> ArrayThe
Intl.DateTimeFormat.prototype.formatToParts()method allows locale-aware formatting of strings produced by DateTimeFormat formatters.
impl DateTimeFormat
fn resolved_options(&self) -> ObjectThe
Intl.DateTimeFormat.prototype.resolvedOptions()method returns a new object with properties reflecting the locale and date and time formatting options computed during initialization of this DateTimeFormat object.
impl DateTimeFormat
fn format_range(&self, start_date: &Date, end_date: &Date) -> Result<JsString, JsValue>The
Intl.DateTimeFormat.prototype.formatRange()method formats a date range in the most concise way based on the locales and options provided when instantiating thisIntl.DateTimeFormatobject.Throws a
TypeErrorif the dates are invalid.
impl DateTimeFormat
fn supported_locales_of(locales: &Array, options: &Object) -> ArrayThe
Intl.DateTimeFormat.supportedLocalesOf()method returns an array containing those of the provided locales that are supported in date and time formatting without having to fall back to the runtime's default locale.
Trait Implementations
impl AsRef<DateTimeFormat> for DateTimeFormat
fn as_ref(&self) -> &DateTimeFormat
impl AsRef<JsValue> for DateTimeFormat
fn as_ref(&self) -> &JsValue
impl AsRef<Object> for DateTimeFormat
fn as_ref(&self) -> &Object
impl Clone for DateTimeFormat
fn clone(&self) -> Self
impl Debug for DateTimeFormat
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for DateTimeFormat
fn default() -> Self
impl Deref for DateTimeFormat
type Target = Object;fn deref(&self) -> &Object
impl ErasableGeneric for DateTimeFormat
type Repr = JsValue;
impl From<JsValue> for DateTimeFormat
fn from(obj: JsValue) -> Self
impl FromWasmAbi for DateTimeFormat
type Abi = <JsValue as FromWasmAbi>::Abi;unsafe fn from_abi(js: Self::Abi) -> Self
impl IntoJsGeneric for DateTimeFormat
where
DateTimeFormat: JsGeneric,
type JsCanon = DateTimeFormat;fn to_js(self) -> DateTimeFormat
impl IntoWasmAbi for DateTimeFormat
type Abi = <JsValue as IntoWasmAbi>::Abi;fn into_abi(self) -> Self::Abi
impl JsCast for DateTimeFormat
fn instanceof(val: &JsValue) -> boolfn unchecked_from_js(val: JsValue) -> Selffn unchecked_from_js_ref(val: &JsValue) -> &Self
impl LongRefFromWasmAbi for DateTimeFormat
type Abi = <JsValue as LongRefFromWasmAbi>::Abi;type Anchor = DateTimeFormat;unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
impl OptionFromWasmAbi for DateTimeFormat
fn is_none(abi: &Self::Abi) -> bool
impl OptionIntoWasmAbi for DateTimeFormat
fn none() -> Self::Abi
impl Promising for DateTimeFormat
type Resolution = DateTimeFormat;
impl RefFromWasmAbi for DateTimeFormat
type Abi = <JsValue as RefFromWasmAbi>::Abi;type Anchor = ManuallyDrop<DateTimeFormat>;unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
impl UpcastFrom<DateTimeFormat> for DateTimeFormat
impl WasmDescribe for DateTimeFormat
fn describe()