Function month_grid

Source
pub fn month_grid(month: MonthValue, week_start: WeekStart) -> [CalendarDay; 42]
Expand description

Generates a fixed 42-cell, six-week calendar grid around month.

Leading and trailing cells belong to adjacent months and have CalendarDay::in_month set to false.

§Panics

Debug builds may panic for extreme i32 years when the delegated weekday or adjacent-day arithmetic overflows.

§Examples

use ailloli_ui_core::date_picker::month_grid;
use ailloli_ui_core::{MonthValue, WeekStart};

let grid = month_grid(MonthValue::new(2026, 5), WeekStart::Monday);
assert_eq!(grid.len(), 42);
assert!(grid.iter().any(|day| !day.in_month));