pub struct GregorianCalendarDelegate;Expand description
A CalendarDelegate for the Gregorian calendar, which is what DateUtils computes in.
Trait Implementations§
Source§impl CalendarDelegate for GregorianCalendarDelegate
impl CalendarDelegate for GregorianCalendarDelegate
Source§fn date_only(&self, app: &App, date: &DateTime) -> DateTime
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
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
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
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
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
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 format_month_year(
&self,
app: &App,
date: &DateTime,
localizations: &dyn MaterialLocalizations,
) -> String
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
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
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
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
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
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>
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
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
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
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
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
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>>
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
impl Clone for GregorianCalendarDelegate
impl Copy for GregorianCalendarDelegate
Source§impl Debug for GregorianCalendarDelegate
impl Debug for GregorianCalendarDelegate
Auto Trait Implementations§
impl Forget for GregorianCalendarDelegate
impl Freeze for GregorianCalendarDelegate
impl Move for GregorianCalendarDelegate
impl RefUnwindSafe for GregorianCalendarDelegate
impl Send for GregorianCalendarDelegate
impl Sync for GregorianCalendarDelegate
impl Unpin for GregorianCalendarDelegate
impl UnsafeUnpin for GregorianCalendarDelegate
impl UnwindSafe for GregorianCalendarDelegate
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