mirror of
https://github.com/nushell/nushell.git
synced 2024-11-22 08:23:24 +01:00
add table -> table
to into datetime
(#9775)
should close https://github.com/nushell/nushell/issues/9774 # Description given the help page of `into datetime`, ``` Parameters: ...rest <cellpath>: for a data structure input, convert data at the given cell paths ``` it looks like `into datetime` should accept tables as input 🤔 this PR - adds the `table -> table` signature to `into datetime` - adds a test to make sure the behaviour stays there
This commit is contained in:
parent
75180d07de
commit
79359598db
@ -68,7 +68,9 @@ impl Command for SubCommand {
|
|||||||
(Type::Int, Type::Date),
|
(Type::Int, Type::Date),
|
||||||
(Type::String, Type::Date),
|
(Type::String, Type::Date),
|
||||||
(Type::List(Box::new(Type::String)), Type::List(Box::new(Type::Date))),
|
(Type::List(Box::new(Type::String)), Type::List(Box::new(Type::Date))),
|
||||||
|
(Type::Table(vec![]), Type::Table(vec![])),
|
||||||
])
|
])
|
||||||
|
.allow_variants_without_examples(true)
|
||||||
.named(
|
.named(
|
||||||
"timezone",
|
"timezone",
|
||||||
SyntaxShape::String,
|
SyntaxShape::String,
|
||||||
|
8
crates/nu-command/tests/commands/into_datetime.rs
Normal file
8
crates/nu-command/tests/commands/into_datetime.rs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
use nu_test_support::nu;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn into_datetime_table_column() {
|
||||||
|
let actual = nu!(r#"[[date]; ["2022-01-01"] ["2023-01-01"]] | into datetime date"#);
|
||||||
|
|
||||||
|
assert!(actual.out.contains(" ago"));
|
||||||
|
}
|
@ -39,6 +39,7 @@ mod help;
|
|||||||
mod histogram;
|
mod histogram;
|
||||||
mod insert;
|
mod insert;
|
||||||
mod inspect;
|
mod inspect;
|
||||||
|
mod into_datetime;
|
||||||
mod into_filesize;
|
mod into_filesize;
|
||||||
mod into_int;
|
mod into_int;
|
||||||
mod join;
|
mod join;
|
||||||
|
Loading…
Reference in New Issue
Block a user