Skip to main content

step_date_field

Function step_date_field 

Source
pub fn step_date_field(date: Date, kind: SegmentKind, delta: i32) -> Date
Expand description

Step a single field of a Date by delta. Year saturates at the jiff range and clamps the day if the new year+month no longer holds the current day (e.g. Feb 29 → Feb 28 in non-leap years). Month wraps within [1, 12] and clamps the day to the new month’s last day. Day wraps within the current month — does not advance to the next month, matching Qt QDateEdit and macOS Calendar behaviour. Returns the input date unchanged when kind is not a date field.