Function weekday_index

Source
pub fn weekday_index(date: DateValue, week_start: WeekStart) -> u8
Expand description

Returns the zero-based weekday column for date and week_start.

The result is always in 0..=6; 0 denotes the requested first weekday.

§Panics

Debug builds may panic for extreme i32 years whose calendar arithmetic overflows.

§Examples

use ailloli_ui_core::date_picker::weekday_index;
use ailloli_ui_core::{DateValue, WeekStart};

assert_eq!(weekday_index(DateValue::new(2026, 5, 4), WeekStart::Monday), 0);