Function add_months

Source
pub fn add_months(month: MonthValue, delta: i32) -> MonthValue
Expand description

Adds a signed number of calendar months using Euclidean year rollover.

§Panics

Debug builds may panic if the intermediate year * 12 + delta overflows i32; use ordinary application-scale years and deltas.

§Examples

use ailloli_ui_core::date_picker::add_months;
use ailloli_ui_core::MonthValue;

assert_eq!(add_months(MonthValue::new(2026, 1), -2), MonthValue::new(2025, 11));