diff --git a/Cargo.lock b/Cargo.lock index 95403e59..96f380ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1806,6 +1806,7 @@ dependencies = [ "sha2", "textnonce", "thiserror", + "time", "tokio", "tokio-tungstenite", "tracing", @@ -3829,6 +3830,33 @@ dependencies = [ "weezl", ] +[[package]] +name = "time" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" +dependencies = [ + "itoa", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "time-macros" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +dependencies = [ + "time-core", +] + [[package]] name = "tiny-skia" version = "0.6.6" diff --git a/Cargo.toml b/Cargo.toml index 34b7abe1..95f44fae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,6 +38,7 @@ serde_json = "1.0" sha2 = "0.10" textnonce = "1.0" thiserror = "1.0" +time = { version = "0.3", features = [ "formatting" ] } tokio = { version = "1", features = ["full"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = [ "std", "env-filter" ] } diff --git a/src/ui/you/metadata.rs b/src/ui/you/metadata.rs index 4ab5a9ee..e09bff86 100644 --- a/src/ui/you/metadata.rs +++ b/src/ui/you/metadata.rs @@ -41,6 +41,15 @@ pub(super) fn update(app: &mut GossipUi, _ctx: &Context, _frame: &mut eframe::Fr None => &EMPTY_METADATA, }; + if let Some(metadata_at) = you.metadata_at { + if let Ok(stamp) = time::OffsetDateTime::from_unix_timestamp(metadata_at) { + if let Ok(formatted) = stamp.format(&time::format_description::well_known::Rfc2822) { + ui.label(format!("Date Stamp of Fetched Metadata is {}", formatted)); + ui.add_space(18.0); + } + } + } + if app.editing_metadata { edit_line(ui, "Name", &mut app.metadata.name); ui.add_space(18.0);