Add datetime to math-like (#5118)

* Add datetime to math-like

* add test
This commit is contained in:
JT 2022-04-07 18:02:28 +12:00 committed by GitHub
parent 4409185e1b
commit 888369022f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -84,6 +84,10 @@ pub fn is_math_expression_like(
return true;
}
if parse_datetime(working_set, span).1.is_none() {
return true;
}
if parse_binary(working_set, span).1.is_none() {
return true;
}

View file

@ -411,3 +411,8 @@ fn unary_not_6() -> TestResult {
"def",
)
}
#[test]
fn date_literal() -> TestResult {
run_test(r#"2022-09-10 | date to-record | get day"#, "10")
}