date_validation_types 2.0.0

- Types for validating if a u32 value is valid for a day, month or year. - Type to for a valid date coming from simple integer value
Documentation
1
2
3
4
5
6
7
8
9
use chrono::Datelike;
use once_cell::sync::Lazy;

pub const MONTH_LOWER_BOUND: u32 = 1;
pub const MONTH_UPPER_BOUND: u32 = 12;

pub const DAY_LOWER_BOUND: u32 = 1;
pub const DAY_UPPER_BOUND: u32 = 31;
pub static YEAR_UPPER_BOUND: Lazy<u32> = Lazy::new(|| chrono::NaiveDate::MAX.year() as u32);