#[inline(always)]
pub(crate) const fn ok_year(year: u16) -> bool {
year >= 1000 && year <= 9999
}
#[inline(always)]
pub(crate) const fn ok_month(month: u8) -> bool {
month >= 1 && month <= 12
}
#[inline(always)]
pub(crate) const fn ok_day(day: u8) -> bool {
day >= 1 && day <= 31
}
#[inline(always)]
pub(crate) const fn ok(year: u16, month: u8, day: u8) -> bool {
ok_year(year) && ok_month(month) && ok_day(day)
}
#[inline]
pub fn date() -> (i16, u8, u8) {
use chrono::Datelike;
let now = chrono::offset::Local::now().date_naive();
(now.year() as i16, now.month() as u8, now.day() as u8)
}
#[inline]
pub fn date_utc() -> (i16, u8, u8) {
let unix = chrono::offset::Local::now().timestamp() as i128;
nichi::Date::from_unix(unix).inner()
}