pub fn parse_yearless_date_component(
s: &str,
position: &mut usize,
) -> Option<YearlessDate>
Expand description
Low-level function for parsing an individual yearless date component at a given position
This follows the rules for parsing a yearless date component per WHATWG HTML Standard § 2.3.5.3 Yearless dates.
Note: This function exposes a lower-level API than
parse_yearless_date
. More than likely, you will want to useparse_yearless_date
instead.
§Examples
use whatwg_datetime::{parse_yearless_date_component, YearlessDate};
let mut position = 0usize;
let date = parse_yearless_date_component("11-18", &mut position);
assert_eq!(date, YearlessDate::new_opt(11, 18));