mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
wallet: chatview switch timestamp from millis to secs
This commit is contained in:
@@ -754,7 +754,7 @@ fn populate_tree(tree: &sled::Tree) {
|
||||
let min = min.parse::<u32>().unwrap();
|
||||
let dt: NaiveDateTime =
|
||||
NaiveDate::from_ymd_opt(2024, 8, 6).unwrap().and_hms_opt(hour, min, 0).unwrap();
|
||||
let timest = dt.and_utc().timestamp_millis() as u64;
|
||||
let timest = dt.and_utc().timestamp() as u64;
|
||||
|
||||
let message_id = [0u8; 32];
|
||||
let nick = parts[1].to_string();
|
||||
|
||||
@@ -639,7 +639,7 @@ impl ChatView {
|
||||
|
||||
let chatmsg = ChatMsg { nick, text };
|
||||
|
||||
let dt = Local.timestamp_millis_opt(timest as i64).unwrap();
|
||||
let dt = Local.timestamp_opt(timest as i64, 0).unwrap();
|
||||
let timestr = dt.format("%H:%M").to_string();
|
||||
|
||||
let text = format!("{} {} {}", timestr, chatmsg.nick, chatmsg.text);
|
||||
@@ -822,7 +822,7 @@ impl ChatView {
|
||||
let chatmsg: ChatMsg = deserialize(&v).unwrap();
|
||||
debug!(target: "ui::chatview", "{timest:?} {chatmsg:?}");
|
||||
|
||||
let dt = Local.timestamp_millis_opt(timest as i64).unwrap();
|
||||
let dt = Local.timestamp_opt(timest as i64, 0).unwrap();
|
||||
let timestr = dt.format("%H:%M").to_string();
|
||||
|
||||
let text = format!("{} {} {}", timestr, chatmsg.nick, chatmsg.text);
|
||||
|
||||
Reference in New Issue
Block a user