diff --git a/crates/nu-command/src/conversions/into/datetime.rs b/crates/nu-command/src/conversions/into/datetime.rs index 1a524cd81d..c826258df6 100644 --- a/crates/nu-command/src/conversions/into/datetime.rs +++ b/crates/nu-command/src/conversions/into/datetime.rs @@ -68,7 +68,9 @@ impl Command for SubCommand { (Type::Int, Type::Date), (Type::String, 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( "timezone", SyntaxShape::String, diff --git a/crates/nu-command/tests/commands/into_datetime.rs b/crates/nu-command/tests/commands/into_datetime.rs new file mode 100644 index 0000000000..b741413e20 --- /dev/null +++ b/crates/nu-command/tests/commands/into_datetime.rs @@ -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")); +} diff --git a/crates/nu-command/tests/commands/mod.rs b/crates/nu-command/tests/commands/mod.rs index 90d8cf21c1..7fb76f0f21 100644 --- a/crates/nu-command/tests/commands/mod.rs +++ b/crates/nu-command/tests/commands/mod.rs @@ -39,6 +39,7 @@ mod help; mod histogram; mod insert; mod inspect; +mod into_datetime; mod into_filesize; mod into_int; mod join;