mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 23:00:04 -04:00
Replace chrono with jiff (#8008)
`jiff` is more modern, and seem to be where the ecosystem is heading.
This commit is contained in:
@@ -42,15 +42,15 @@ wayland = ["eframe/wayland"]
|
||||
x11 = ["eframe/x11"]
|
||||
|
||||
[dependencies]
|
||||
chrono = { workspace = true, features = ["js-sys", "wasmbind"] }
|
||||
eframe = { workspace = true, default-features = false, features = ["web_screen_reader"] }
|
||||
egui = { workspace = true, features = ["callstack", "default"] }
|
||||
egui_demo_lib = { workspace = true, features = ["default", "chrono"] }
|
||||
egui_demo_lib = { workspace = true, features = ["default", "jiff"] }
|
||||
egui_extras = { workspace = true, features = ["default", "image"] }
|
||||
image = { workspace = true, default-features = false, features = [
|
||||
# Ensure we can display the test images
|
||||
"png",
|
||||
] }
|
||||
jiff = { workspace = true, features = ["std", "tz-system", "js"] }
|
||||
log.workspace = true
|
||||
profiling.workspace = true
|
||||
|
||||
|
||||
@@ -9,9 +9,10 @@ pub use wrap_app::{Anchor, WrapApp};
|
||||
|
||||
/// Time of day as seconds since midnight. Used for clock in demo app.
|
||||
pub(crate) fn seconds_since_midnight() -> f64 {
|
||||
use chrono::Timelike as _;
|
||||
let time = chrono::Local::now().time();
|
||||
time.num_seconds_from_midnight() as f64 + 1e-9 * (time.nanosecond() as f64)
|
||||
jiff::Zoned::now()
|
||||
.time()
|
||||
.duration_since(jiff::civil::Time::midnight())
|
||||
.as_secs_f64()
|
||||
}
|
||||
|
||||
/// Trait that wraps different parts of the demo app.
|
||||
|
||||
Reference in New Issue
Block a user