This commit is contained in:
Douglas 2025-03-12 18:45:54 -04:00 committed by GitHub
commit c730a7c88b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 16 additions and 16 deletions

View File

@ -103,7 +103,7 @@ impl Command for Describe {
"category" => Value::test_string("default"),
)),
)),
"first_commit" => Value::test_string("date"),
"first_commit" => Value::test_string("datetime"),
"my_duration" => Value::test_string("duration"),
)),
))),

View File

@ -120,7 +120,7 @@ impl<'a> StyleComputer<'a> {
("int".to_string(), ComputableStyle::Static(Color::White.normal())),
("filesize".to_string(), ComputableStyle::Static(Color::Cyan.normal())),
("duration".to_string(), ComputableStyle::Static(Color::White.normal())),
("date".to_string(), ComputableStyle::Static(Color::Purple.normal())),
("datetime".to_string(), ComputableStyle::Static(Color::Purple.normal())),
("range".to_string(), ComputableStyle::Static(Color::White.normal())),
("float".to_string(), ComputableStyle::Static(Color::White.normal())),
("string".to_string(), ComputableStyle::Static(Color::White.normal())),

View File

@ -208,7 +208,7 @@ fn process_cell(val: Value, display_as_filesizes: bool, span: Span) -> Result<Va
}
} else if DATETIME_DMY_RE.is_match(&val_str).unwrap_or(false) {
let dt = parse_date_from_string(&val_str, span).map_err(|_| ShellError::CantConvert {
to_type: "date".to_string(),
to_type: "datetime".to_string(),
from_type: "string".to_string(),
span,
help: Some(format!(
@ -219,7 +219,7 @@ fn process_cell(val: Value, display_as_filesizes: bool, span: Span) -> Result<Va
Ok(Value::date(dt, span))
} else if DATETIME_YMD_RE.is_match(&val_str).unwrap_or(false) {
let dt = parse_date_from_string(&val_str, span).map_err(|_| ShellError::CantConvert {
to_type: "date".to_string(),
to_type: "datetime".to_string(),
from_type: "string".to_string(),
span,
help: Some(format!(
@ -230,7 +230,7 @@ fn process_cell(val: Value, display_as_filesizes: bool, span: Span) -> Result<Va
Ok(Value::date(dt, span))
} else if DATETIME_YMDZ_RE.is_match(&val_str).unwrap_or(false) {
let dt = parse_date_from_string(&val_str, span).map_err(|_| ShellError::CantConvert {
to_type: "date".to_string(),
to_type: "datetime".to_string(),
from_type: "string".to_string(),
span,
help: Some(format!(

File diff suppressed because one or more lines are too long

View File

@ -303,7 +303,7 @@ fn from_nuon_datetime() {
"#
));
assert_eq!(actual.out, "date");
assert_eq!(actual.out, "datetime");
}
#[test]

View File

@ -135,7 +135,7 @@ impl Type {
Type::Closure => String::from("closure"),
Type::Bool => String::from("bool"),
Type::CellPath => String::from("cell-path"),
Type::Date => String::from("date"),
Type::Date => String::from("datetime"),
Type::Duration => String::from("duration"),
Type::Filesize => String::from("filesize"),
Type::Float => String::from("float"),
@ -162,7 +162,7 @@ impl Display for Type {
Type::Closure => write!(f, "closure"),
Type::Bool => write!(f, "bool"),
Type::CellPath => write!(f, "cell-path"),
Type::Date => write!(f, "date"),
Type::Date => write!(f, "datetime"),
Type::Duration => write!(f, "duration"),
Type::Filesize => write!(f, "filesize"),
Type::Float => write!(f, "float"),

View File

@ -324,7 +324,7 @@ impl Value {
if let Value::Date { val, .. } = self {
Ok(*val)
} else {
self.cant_convert_to("date")
self.cant_convert_to("datetime")
}
}

View File

@ -13,7 +13,7 @@ export def dark-theme [] {
int: white
filesize: cyan
duration: white
date: purple
datetime: purple
range: white
float: white
string: white
@ -81,7 +81,7 @@ export def light-theme [] {
int: dark_gray
filesize: cyan_bold
duration: dark_gray
date: purple
datetime: purple
range: dark_gray
float: dark_gray
string: dark_gray

View File

@ -10,7 +10,7 @@ $env.config.color_config = {
int: white
filesize: cyan
duration: white
date: purple
datetime: purple
range: white
float: white
string: white