Struct cursive_calendar_view::CalendarView [] [src]

pub struct CalendarView<T: TimeZone, L: Locale> { /* fields omitted */ }

View for selecting a date, supporting different modes for day, month or year based selection.

View modes can be navigated via Backspace and Enter.

Custom localization is possible by providing an implementation of the Locale trait.

Examples

// Allow selection a date within the year of 2017.
let mut calendar = CalendarView::<UTC, EnglishLocale>::new(UTC::today());

calendar.set_highest_view_mode(ViewMode::Year);
calendar.set_earliest_date(Some(UTC.ymd(2017, 1, 1)));
calendar.set_latest_date(Some(UTC.ymd(2017, 12, 31)));
calendar.set_show_iso_weeks(true);

Methods

impl<T: TimeZone, L: Locale> CalendarView<T, L>
[src]

[src]

Creates new CalendarView.

[src]

Disables this view.

A disabled view cannot be selected.

[src]

Re-enables this view.

[src]

Enable or disable this view.

[src]

Returns true if this view is enabled.

[src]

Returns the currently selected date of this view.

[src]

Sets the currently selected date of this view.

[src]

Sets the currently selected date of this view.

Chainable variant.

[src]

Sets the visually selected date of this view.

[src]

Sets the visually selected date of this view.

Chainable variant.

[src]

Sets the currently active view mode of this view.

[src]

Sets the currently active view mode of this view.

Chainable variant.

[src]

Sets the lowest view mode this calendar can be in.

Can be used conjunction with CalendarView::set_highest_view_mode to limit a CalendarView to only allow selection of days, months or years.

[src]

Sets the lowest view mode this calendar can be in.

Can be used conjunction with CalendarView::set_highest_view_mode to limit a CalendarView to only allow selection of days, months or years.

Chainable variant.

[src]

Sets the highest view mode this calendar can be in.

Can be used conjunction with CalendarView::set_lowest_view_mode to limit a CalendarView to only allow selection of days, months or years.

[src]

Sets the highest view mode this calendar can be in.

Can be used conjunction with CalendarView::set_lowest_view_mode to limit a CalendarView to only allow selection of days, months or years.

Chainable variant.

[src]

Sets and limits the earliest date selectable by this view.

[src]

Sets and limits the earliest date selectable by this view.

Chainable variant.

[src]

Sets and limits the latest date selectable by this view.

[src]

Sets and limits the latest date selectable by this view.

Chainable variant.

[src]

Allows to change the default week start day of WeekDay::Monday to any other WeekDay.

[src]

Allows to change the default week start day of WeekDay::Monday to any other WeekDay.

Chainable variant.

[src]

Show or hide ISO week numbers in the ViewMode::Month view mode.

ISO week numbers only make sense with a week start day of WeekDay::Monday.

[src]

Show or hide ISO week numbers in the ViewMode::Month view mode.

ISO week numbers only make sense with a week start day of WeekDay::Monday.

Chainable variant.

[src]

Sets a callback to be used when <Enter> is pressed to select a date.

[src]

Sets a callback to be used when <Enter> is pressed to select a date.

Chainable variant.

[src]

Sets a callback to be used when an a new date is visually selected.

[src]

Sets a callback to be used when an a new date is visually selected.

Chainable variant.

Trait Implementations

impl<T: TimeZone + 'static, L: Locale> View for CalendarView<T, L>
[src]

[src]

Draws the view with the given printer (includes bounds) and focus.

[src]

Returns the minimum size the view requires with the given restrictions. Read more

[src]

This view is offered focus. Will it take it? Read more

[src]

Called when a key was pressed. Read more

[src]

Returns true if the view content changed since last layout phase. Read more

[src]

Called once the size for this view has been decided, Read more

[src]

Runs a closure on the view identified by the given selector. Read more

[src]

Moves the focus to the view identified by the given selector. Read more