pub struct LocaleTimeFormatter {
pub locale: String,
pub use_24_hour: bool,
pub show_seconds: bool,
pub date_format: Option<String>,
}Expand description
Locale-aware time formatter: month and weekday names and the AM/PM marker
in the locale’s language, laid out as DefaultTimeFormatter does.
The names need the locales cargo feature, on by default; without it they
are English, as with an unknown locale.
Fields§
§locale: StringLocale identifier: language and region, such as "en-US", "ja-JP" or
"de-DE" ("de_DE" also works). Unknown identifiers use English names.
use_24_hour: boolWhether to use 24-hour format
show_seconds: boolWhether to show seconds
date_format: Option<String>strftime pattern for the date in crosshair and tooltip labels; see
DefaultTimeFormatter::date_format.
Implementations§
Trait Implementations§
Source§impl Clone for LocaleTimeFormatter
impl Clone for LocaleTimeFormatter
Source§fn clone(&self) -> LocaleTimeFormatter
fn clone(&self) -> LocaleTimeFormatter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LocaleTimeFormatter
impl Debug for LocaleTimeFormatter
Source§impl TimeFormatter for LocaleTimeFormatter
impl TimeFormatter for LocaleTimeFormatter
Source§fn format(&self, time: DateTime<Utc>, mark_type: TickMarkType) -> String
fn format(&self, time: DateTime<Utc>, mark_type: TickMarkType) -> String
Format a ts into a display string Read more
Source§fn format_crosshair(&self, time: DateTime<Utc>, bar_seconds: i64) -> String
fn format_crosshair(&self, time: DateTime<Utc>, bar_seconds: i64) -> String
Formats the hovered bar, retaining this formatter’s date and clock conventions.
Source§fn clone_box(&self) -> Box<dyn TimeFormatter>
fn clone_box(&self) -> Box<dyn TimeFormatter>
Clone this formatter into a Box
Source§fn format_tick(&self, context: TickMarkContext<'_>) -> Option<String>
fn format_tick(&self, context: TickMarkContext<'_>) -> Option<String>
Formats one axis tick with the active chart locale and display-time fields. Read more
Source§fn wall_time(&self, time: DateTime<Utc>) -> DateTime<Utc>
fn wall_time(&self, time: DateTime<Utc>) -> DateTime<Utc>
Clock-face time used to identify calendar boundaries. The returned UTC value
holds local fields, not another instant.
Source§fn utc_time(&self, wall_time: DateTime<Utc>) -> Option<DateTime<Utc>>
fn utc_time(&self, wall_time: DateTime<Utc>) -> Option<DateTime<Utc>>
Converts local calendar fields from
wall_time back to an instant.
Repeated times use the first instant; skipped times use the clock jump.Source§fn time_visible(&self) -> bool
fn time_visible(&self) -> bool
Whether intraday marks and hover labels include the clock.
Auto Trait Implementations§
impl Freeze for LocaleTimeFormatter
impl RefUnwindSafe for LocaleTimeFormatter
impl Send for LocaleTimeFormatter
impl Sync for LocaleTimeFormatter
impl Unpin for LocaleTimeFormatter
impl UnsafeUnpin for LocaleTimeFormatter
impl UnwindSafe for LocaleTimeFormatter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more