pub struct UseIntlDateTimeFormatReturn;Expand description
Return type of use_intl_datetime_format.
Implementations§
Source§impl UseIntlDateTimeFormatReturn
impl UseIntlDateTimeFormatReturn
Sourcepub fn format<Tz>(
&self,
date: impl Into<Signal<DateTime<Tz>>>,
) -> Signal<String>
pub fn format<Tz>( &self, date: impl Into<Signal<DateTime<Tz>>>, ) -> Signal<String>
Formats a date according to the locale and formatting options of this Intl.DateTimeFormat object.
See use_intl_datetime_format for more information.
In the browser this uses SendWrapper internally so the returned signal can only be used on
the same thread where this method was called.
Sourcepub fn format_range<TzStart, TzEnd>(
&self,
start: impl Into<Signal<DateTime<TzStart>>>,
end: impl Into<Signal<DateTime<TzEnd>>>,
) -> Signal<String>
pub fn format_range<TzStart, TzEnd>( &self, start: impl Into<Signal<DateTime<TzStart>>>, end: impl Into<Signal<DateTime<TzEnd>>>, ) -> Signal<String>
Formats a range of dates according to the locale and formatting options of this
Intl.DateTimeFormat object.
let start = Utc.with_ymd_and_hms(2007, 1, 10, 10, 0, 0).unwrap();
let end = Utc.with_ymd_and_hms(2008, 1, 10, 11, 0, 0).unwrap();
let date_time_format = use_intl_datetime_format(
UseIntlDateTimeFormatOptions::default()
.locale("en-US")
.year(YearFormat::Numeric)
.month(MonthFormat::Short)
.day(DayFormat::Numeric),
);
let formatted = date_time_format.format_range(start, end); // "Jan 10, 2007 – Jan 10, 2008"Auto Trait Implementations§
impl Freeze for UseIntlDateTimeFormatReturn
impl RefUnwindSafe for UseIntlDateTimeFormatReturn
impl Send for UseIntlDateTimeFormatReturn
impl Sync for UseIntlDateTimeFormatReturn
impl Unpin for UseIntlDateTimeFormatReturn
impl UnsafeUnpin for UseIntlDateTimeFormatReturn
impl UnwindSafe for UseIntlDateTimeFormatReturn
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<El, T, Marker> IntoElementMaybeSignal<T, Marker> for Elwhere
El: IntoElementMaybeSignalType<T, Marker>,
impl<El, T, Marker> IntoElementMaybeSignal<T, Marker> for Elwhere
El: IntoElementMaybeSignalType<T, Marker>,
fn into_element_maybe_signal(self) -> ElementMaybeSignal<T>
Source§impl<T, Js> IntoElementMaybeSignalType<T, Element> for Js
impl<T, Js> IntoElementMaybeSignalType<T, Element> for Js
fn into_element_maybe_signal_type(self) -> ElementMaybeSignalType<T>
Source§impl<El, T, Marker> IntoElementsMaybeSignal<T, Marker> for Elwhere
El: IntoElementsMaybeSignalType<T, Marker>,
impl<El, T, Marker> IntoElementsMaybeSignal<T, Marker> for Elwhere
El: IntoElementsMaybeSignalType<T, Marker>,
fn into_elements_maybe_signal(self) -> ElementsMaybeSignal<T>
Source§impl<T, Js> IntoElementsMaybeSignalType<T, Element> for Js
impl<T, Js> IntoElementsMaybeSignalType<T, Element> for Js
fn into_elements_maybe_signal_type(self) -> ElementsMaybeSignalType<T>
Source§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.