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.

MDN documentation

Implementations

impl DateTimeFormat

fn new(locales: &Array, options: &Object) -> DateTimeFormat

The Intl.DateTimeFormat object is a constructor for objects that enable language-sensitive date and time formatting.

MDN documentation

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 by Intl.DateTimeFormat formatters.

Throws a TypeError if the dates are invalid.

MDN documentation

impl DateTimeFormat

fn format(&self) -> Function

The 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.

MDN documentation

impl DateTimeFormat

fn format_to_parts(&self, date: &Date) -> Array

The Intl.DateTimeFormat.prototype.formatToParts() method allows locale-aware formatting of strings produced by DateTimeFormat formatters.

MDN documentation

impl DateTimeFormat

fn resolved_options(&self) -> Object

The 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.

MDN documentation

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 this Intl.DateTimeFormat object.

Throws a TypeError if the dates are invalid.

MDN documentation

impl DateTimeFormat

fn supported_locales_of(locales: &Array, options: &Object) -> Array

The 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.

MDN documentation

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) -> bool
fn unchecked_from_js(val: JsValue) -> Self
fn 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()

Auto Trait Implementations

impl Freeze for DateTimeFormat

impl RefUnwindSafe for DateTimeFormat

impl Send for DateTimeFormat

impl Sync for DateTimeFormat

impl Unpin for DateTimeFormat

impl UnsafeUnpin for DateTimeFormat

impl UnwindSafe for DateTimeFormat

Blanket Implementations

impl<P, T> Receiver for DateTimeFormat where P: Deref<Target = T> + ?Sized, T: ?Sized,

impl<S, T> Upcast<T> for DateTimeFormat where T: UpcastFrom<S> + ?Sized, S: ?Sized,

impl<T> Any for DateTimeFormat where T: 'static + ?Sized,

impl<T> Borrow<T> for DateTimeFormat where T: ?Sized,

impl<T> BorrowMut<T> for DateTimeFormat where T: ?Sized,

impl<T> CloneToUninit for DateTimeFormat where T: Clone,

impl<T> From<T> for DateTimeFormat

impl<T> JsGeneric for DateTimeFormat where T: ErasableGeneric<Repr = JsValue> + UpcastFrom<T> + Upcast<JsValue> + JsCast + 'static,

impl<T> ReturnWasmAbi for DateTimeFormat where T: IntoWasmAbi,

impl<T> ToOwned for DateTimeFormat where T: Clone,

impl<T> TryFromJsValue for DateTimeFormat where T: JsCast,

impl<T> VectorFromWasmAbi for DateTimeFormat where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorIntoWasmAbi for DateTimeFormat where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorRefIntoWasmAbi for DateTimeFormat where &'a T: for<'a> Into<JsValue>,

impl<T, U> Into<U> for DateTimeFormat where U: From<T>,

impl<T, U> TryFrom<U> for DateTimeFormat where U: Into<T>,

impl<T, U> TryInto<U> for DateTimeFormat where U: TryFrom<T>,