Remove month and year duration constants (#6613)

remove month/year/decade durations for parsing and units, but leave the humanized output for viewing
This commit is contained in:
JT
2022-09-26 09:55:13 +13:00
committed by GitHub
parent 43905caa46
commit d66a5398d1
6 changed files with 2 additions and 82 deletions

View File

@ -2201,9 +2201,6 @@ pub fn parse_duration_bytes(bytes: &[u8], span: Span) -> Option<Expression> {
(Unit::Hour, "HR", Some((Unit::Minute, 60))),
(Unit::Day, "DAY", Some((Unit::Minute, 1440))),
(Unit::Week, "WK", Some((Unit::Day, 7))),
(Unit::Month, "MONTH", Some((Unit::Day, 30))), //30 day month
(Unit::Year, "YR", Some((Unit::Day, 365))), //365 day year
(Unit::Decade, "DEC", Some((Unit::Year, 10))), //365 day years
];
if let Some(unit) = unit_groups.iter().find(|&x| upper.ends_with(x.1)) {
let mut lhs = token;