pub struct EventCalendar { /* private fields */ }Expand description
A month with its events inside each day, for agendas and bookings. Use a
Calendar to pick a date and this to see what is on them.
From the keyboard the grid is one Tab stop: arrows move by day and week, Home and End to the ends of the week, Page Up and Page Down by month, and Enter or Space picks. A day’s name reads out what is on it.
use ravenrs_reactive::State;
use ravenrs_widgets::{Date, CalendarEvent, EventCalendar, Tone, Ui};
let today = Date::new(2026, 11, 15).unwrap();
let (month, day) = (State::new(today.first_of_month()), State::new(Some(today)));
let calendar = EventCalendar::new(month.binding(), day.binding())
.today(today)
.events([CalendarEvent::new(1, today, "Aluguel").tone(Tone::Warning)]);
let mut ui = Ui::new(calendar, ravenrs_style::Theme::raven_light());
ui.update();Implementations§
Source§impl EventCalendar
impl EventCalendar
Sourcepub fn new(month: Binding<Date>, selected: Binding<Option<Date>>) -> Self
pub fn new(month: Binding<Date>, selected: Binding<Option<Date>>) -> Self
month holds the month shown (any day of it), so the app can load its
events; selected holds the day picked.
Sourcepub fn events(self, events: impl IntoIterator<Item = CalendarEvent>) -> Self
pub fn events(self, events: impl IntoIterator<Item = CalendarEvent>) -> Self
The events; those outside the days shown are ignored.
Sourcepub fn today(self, today: Date) -> Self
pub fn today(self, today: Date) -> Self
Marks this day, and offers a button to come back to it.
Sourcepub fn events_per_day(self, count: usize) -> Self
pub fn events_per_day(self, count: usize) -> Self
How many events show in a day before the rest become a count (3 by default).
Trait Implementations§
Source§impl Debug for EventCalendar
impl Debug for EventCalendar
Auto Trait Implementations§
impl !RefUnwindSafe for EventCalendar
impl !Send for EventCalendar
impl !Sync for EventCalendar
impl !UnwindSafe for EventCalendar
impl Freeze for EventCalendar
impl Unpin for EventCalendar
impl UnsafeUnpin for EventCalendar
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<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<V> ViewExt for Vwhere
V: View,
impl<V> ViewExt for Vwhere
V: View,
Source§fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
Adds padding inside the box, in logical pixels.
Source§fn background(self, fill: impl Into<Fill>) -> Styled<Self>
fn background(self, fill: impl Into<Fill>) -> Styled<Self>
Paints a background behind the content.
Source§fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
Fixes the width and/or height in logical pixels;
None keeps the content size.