Fusuma

Components / Date and time

first_cell

Which cell of a grid that starts its weeks on Monday (monday_first) or Sunday holds the first of the month.

Which cell of a grid that starts its weeks on Monday (monday_first) or Sunday holds the first of the month.

Signature

pub const fn first_cell(year: i32, month: u8, monday_first: bool) -> u8

Example

use fusuma::first_cell;
// 1 February 2024 was a Thursday: the fourth cell of a week that starts on Monday, the fifth on Sunday.
assert_eq!(first_cell(2024, 2, true), 3);
assert_eq!(first_cell(2024, 2, false), 4);

All components · Source