Function veeks_millis::veek_to_naive_date_opt[][src]

pub fn veek_to_naive_date_opt(s: &str) -> Option<NaiveDate>

convert String with veek format to chrono NaiveDate return None if the string is not in a correct veek-format veek format in short: 4 digit year has the unit c for CE common era, one space 2 digit for veek (very similar to week) from 01v to 53v, has unit v, one space 1 digit for veek-day from 1d (monday) to 7d(sunday)

Example

use chrono::{Datelike, NaiveDate, NaiveTime, Timelike};
let nd = veeks_millis::veek_to_naive_date_opt("2021c 09v 3d").unwrap();
assert_eq!(nd, NaiveDate::from_ymd(2021,02,28));