0.6.0 #1
3 changed files with 24 additions and 5 deletions
|
@ -9,6 +9,7 @@ All notable changes to eww will be listed here, starting at changes since versio
|
|||
Attempting to index in an empty JSON string (`'""'`) is now an error.
|
||||
|
||||
### Fixes
|
||||
- Fix crash on invalid `formattime` format string (By: luca3s)
|
||||
- Fix crash on NaN or infinite graph value (By: luca3s)
|
||||
- Re-enable some scss features (By: w-lfchen)
|
||||
- Fix and refactor nix flake (By: w-lfchen)
|
||||
|
|
12
Cargo.lock
generated
12
Cargo.lock
generated
|
@ -501,9 +501,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
|
|||
|
||||
[[package]]
|
||||
name = "chrono"
|
||||
version = "0.4.38"
|
||||
version = "0.4.41"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401"
|
||||
checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d"
|
||||
dependencies = [
|
||||
"android-tzdata",
|
||||
"iana-time-zone",
|
||||
|
@ -511,7 +511,7 @@ dependencies = [
|
|||
"num-traits",
|
||||
"pure-rust-locales",
|
||||
"wasm-bindgen",
|
||||
"windows-targets 0.52.6",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -3290,6 +3290,12 @@ dependencies = [
|
|||
"syn 2.0.87",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-link"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38"
|
||||
|
||||
[[package]]
|
||||
name = "windows-result"
|
||||
version = "0.1.2"
|
||||
|
|
|
@ -501,14 +501,26 @@ fn call_expr_function(name: &str, args: Vec<DynVal>) -> Result<DynVal, EvalError
|
|||
|
||||
Ok(DynVal::from(match timezone.timestamp_opt(timestamp.as_i64()?, 0) {
|
||||
LocalResult::Single(t) | LocalResult::Ambiguous(t, _) => {
|
||||
t.format_localized(&format.as_string()?, get_locale()).to_string()
|
||||
let format = format.as_string()?;
|
||||
let delayed_format = t.format_localized(&format, get_locale());
|
||||
let mut buffer = String::new();
|
||||
if delayed_format.write_to(&mut buffer).is_err() {
|
||||
return Err(EvalError::ChronoError("Invalid time formatting string: ".to_string() + &format));
|
||||
}
|
||||
buffer
|
||||
}
|
||||
LocalResult::None => return Err(EvalError::ChronoError("Invalid UNIX timestamp".to_string())),
|
||||
}))
|
||||
}
|
||||
[timestamp, format] => Ok(DynVal::from(match Local.timestamp_opt(timestamp.as_i64()?, 0) {
|
||||
LocalResult::Single(t) | LocalResult::Ambiguous(t, _) => {
|
||||
t.format_localized(&format.as_string()?, get_locale()).to_string()
|
||||
let format = format.as_string()?;
|
||||
let delayed_format = t.format_localized(&format, get_locale());
|
||||
let mut buffer = String::new();
|
||||
if delayed_format.write_to(&mut buffer).is_err() {
|
||||
return Err(EvalError::ChronoError("Invalid time formatting string: ".to_string() + &format));
|
||||
}
|
||||
buffer
|
||||
}
|
||||
LocalResult::None => return Err(EvalError::ChronoError("Invalid UNIX timestamp".to_string())),
|
||||
})),
|
||||
|
|
Loading…
Add table
Reference in a new issue