Skip to main content

parse_mac_date_checked

Function parse_mac_date_checked 

Source
pub fn parse_mac_date_checked(s: &str) -> Result<u32, String>
Expand description

Like parse_mac_date but returns a short, specific reason on failure (e.g. “month 13 is out of range”, “day 29 is invalid for 1997-02”) so the date editor can tell the user exactly what’s wrong. Leap-year / days-per-month validity is delegated to chrono’s from_ymd_opt.