Skip to main content

GregorianCalendarDelegate

Struct GregorianCalendarDelegate 

Source
pub struct GregorianCalendarDelegate;
Expand description

A CalendarDelegate for the Gregorian calendar, which is what DateUtils computes in.

Trait Implementations§

Source§

impl CalendarDelegate for GregorianCalendarDelegate

Source§

fn now(&self, _app: &App) -> DateTime

Returns a DateTime representing the current moment.
Source§

fn date_only(&self, app: &App, date: &DateTime) -> DateTime

Returns a DateTime with the date of the original, but time set to midnight.
Source§

fn month_delta( &self, app: &App, start_date: &DateTime, end_date: &DateTime, ) -> i32

Determines the number of months between two DateTime objects.
Source§

fn add_months_to_month_date( &self, app: &App, month_date: &DateTime, months_to_add: i32, ) -> DateTime

Returns a DateTime with the added number of months and the day set to 1 and time set to midnight.
Source§

fn add_days_to_date(&self, app: &App, date: &DateTime, days: i32) -> DateTime

Returns a DateTime with the added number of days and time set to midnight.
Source§

fn first_day_offset( &self, app: &App, year: i32, month: i32, localizations: &dyn MaterialLocalizations, ) -> i32

Computes the offset from the first day of the week that the first day of the month falls on.
Source§

fn get_days_in_month(&self, year: i32, month: i32) -> i32

Returns the number of days in a month, according to the proleptic Gregorian calendar.
Source§

fn get_month(&self, app: &App, year: i32, month: i32) -> DateTime

Returns a DateTime with the given year and month, on the first day of the month.
Source§

fn get_day(&self, app: &App, year: i32, month: i32, day: i32) -> DateTime

Returns a DateTime with the given year, month and day.
Source§

fn format_month_year( &self, app: &App, date: &DateTime, localizations: &dyn MaterialLocalizations, ) -> String

Formats the month and the year of the given DateTime.
Source§

fn format_medium_date( &self, app: &App, date: &DateTime, localizations: &dyn MaterialLocalizations, ) -> String

Formats the given DateTime as a medium-length date.
Source§

fn format_short_month_day( &self, app: &App, date: &DateTime, localizations: &dyn MaterialLocalizations, ) -> String

Formats the month and day of the given DateTime, in a short form.
Source§

fn format_short_date( &self, app: &App, date: &DateTime, localizations: &dyn MaterialLocalizations, ) -> String

Formats the given DateTime as a short date.
Source§

fn format_full_date( &self, app: &App, date: &DateTime, localizations: &dyn MaterialLocalizations, ) -> String

Formats the given DateTime as a full date.
Source§

fn format_compact_date( &self, app: &App, date: &DateTime, localizations: &dyn MaterialLocalizations, ) -> String

Formats the given DateTime as a compact date.
Source§

fn parse_compact_date( &self, app: &App, input_string: Option<&str>, localizations: &dyn MaterialLocalizations, ) -> Option<DateTime>

Parses the given input string as a compact date.
Source§

fn date_help_text(&self, localizations: &dyn MaterialLocalizations) -> String

The help text displayed in the input date picker.
Source§

fn dates_only(&self, app: &App, range: &DateTimeRange) -> DateTimeRange

Returns a DateTimeRange with the dates of the original, but times set to midnight.
Source§

fn is_same_day( &self, app: &App, date_a: Option<&DateTime>, date_b: Option<&DateTime>, ) -> bool

Returns true if the two DateTime objects have the same day, month, and year, or are both null.
Source§

fn is_same_month( &self, app: &App, date_a: Option<&DateTime>, date_b: Option<&DateTime>, ) -> bool

Returns true if the two DateTime objects have the same month and year, or are both null.
Source§

fn format_year( &self, app: &App, year: i32, localizations: &dyn MaterialLocalizations, ) -> String

Formats the given year as a year.
Source§

fn keyboard_input_formatters( &self, _localizations: &dyn MaterialLocalizations, ) -> Option<Vec<TextInputFormatterRef>>

The formatters that restrict what a user may type when entering dates by keyboard.
Source§

impl Clone for GregorianCalendarDelegate

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for GregorianCalendarDelegate

Source§

impl Debug for GregorianCalendarDelegate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GregorianCalendarDelegate

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,