mirror of
https://github.com/ilya-zlobintsev/LACT.git
synced 2026-08-17 16:34:54 -05:00
fix: show time in local timezone in chart rendering
This commit is contained in:
Generated
+6
-6
@@ -1764,7 +1764,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lact"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"divan",
|
||||
@@ -1776,7 +1776,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lact-cli"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"lact-client",
|
||||
@@ -1786,7 +1786,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lact-client"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
dependencies = [
|
||||
"amdgpu-sysfs",
|
||||
"anyhow",
|
||||
@@ -1801,7 +1801,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lact-daemon"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
dependencies = [
|
||||
"amdgpu-sysfs",
|
||||
"anyhow",
|
||||
@@ -1841,7 +1841,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lact-gui"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
dependencies = [
|
||||
"amdgpu-sysfs",
|
||||
"anyhow",
|
||||
@@ -1876,7 +1876,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lact-schema"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
dependencies = [
|
||||
"amdgpu-sysfs",
|
||||
"anyhow",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "lact-cli"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
edition.workspace = true
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "lact-client"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
edition.workspace = true
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "lact-daemon"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
edition.workspace = true
|
||||
|
||||
[features]
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "lact-gui"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
authors = ["Ilya Zlobintsev <ilya.zl@protonmail.com>"]
|
||||
edition.workspace = true
|
||||
|
||||
|
||||
@@ -119,8 +119,14 @@ pub fn fmt_clockspeed(clock_mhz: Option<u64>, ratio: f64) -> String {
|
||||
}
|
||||
|
||||
pub fn fmt_timestamp_to_dt(timestamp_ms: &i64) -> String {
|
||||
fmt_timestamp_to_dt_with_tz(timestamp_ms, jiff::tz::TimeZone::system())
|
||||
}
|
||||
|
||||
fn fmt_timestamp_to_dt_with_tz(timestamp_ms: &i64, tz: jiff::tz::TimeZone) -> String {
|
||||
let date_time = jiff::Timestamp::from_millisecond(*timestamp_ms).unwrap();
|
||||
date_time.strftime("%H:%M:%S").to_string()
|
||||
jiff::Zoned::new(date_time, tz)
|
||||
.strftime("%H:%M:%S")
|
||||
.to_string()
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
@@ -308,7 +314,10 @@ mod tests {
|
||||
#[test]
|
||||
fn fmt_timestamp_to_dt_formats_time() {
|
||||
let timestamp_ms = 0;
|
||||
assert_eq!(fmt_timestamp_to_dt(×tamp_ms), "00:00:00");
|
||||
assert_eq!(
|
||||
fmt_timestamp_to_dt_with_tz(×tamp_ms, jiff::tz::TimeZone::UTC),
|
||||
"00:00:00"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "lact-schema"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
edition.workspace = true
|
||||
|
||||
[features]
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "lact"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
edition.workspace = true
|
||||
|
||||
[features]
|
||||
|
||||
@@ -3,7 +3,7 @@ metadata:
|
||||
description: GPU control utility
|
||||
arch: x86_64
|
||||
license: MIT
|
||||
version: 0.10.0
|
||||
version: 0.10.1
|
||||
maintainer: ilya-zlobintsev
|
||||
url: https://github.com/ilya-zlobintsev/lact
|
||||
source:
|
||||
|
||||
@@ -3,7 +3,7 @@ metadata:
|
||||
description: GPU control utility
|
||||
arch: x86_64
|
||||
license: MIT
|
||||
version: 0.10.0
|
||||
version: 0.10.1
|
||||
maintainer: ilya-zlobintsev
|
||||
url: https://github.com/ilya-zlobintsev/lact
|
||||
source:
|
||||
|
||||
Reference in New Issue
Block a user