mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 02:17:57 +02:00
Extracted grouping by date to it's own subcommand. (#1792)
This commit is contained in:
committed by
GitHub
parent
5fbe5cf785
commit
fc8ee8e4b9
@ -392,6 +392,7 @@ pub fn as_path_member(value: &Value) -> Result<PathMember, ShellError> {
|
||||
pub fn as_string(value: &Value) -> Result<String, ShellError> {
|
||||
match &value.value {
|
||||
UntaggedValue::Primitive(Primitive::String(s)) => Ok(s.clone()),
|
||||
UntaggedValue::Primitive(Primitive::Date(dt)) => Ok(dt.format("%Y-%b-%d").to_string()),
|
||||
UntaggedValue::Primitive(Primitive::Boolean(x)) => Ok(format!("{}", x)),
|
||||
UntaggedValue::Primitive(Primitive::Decimal(x)) => Ok(format!("{}", x)),
|
||||
UntaggedValue::Primitive(Primitive::Int(x)) => Ok(format!("{}", x)),
|
||||
|
Reference in New Issue
Block a user