wip: refactor

This commit is contained in:
2025-01-12 15:53:44 +07:00
parent 923966fb95
commit a9d109486e
6 changed files with 124 additions and 147 deletions

View File

@@ -46,9 +46,9 @@ pub fn show_npub(public_key: PublicKey, len: usize) -> String {
)
}
pub fn ago(time: u64) -> String {
pub fn ago(time: Timestamp) -> String {
let now = Local::now();
let input_time = Local.timestamp_opt(time as i64, 0).unwrap();
let input_time = Local.timestamp_opt(time.as_u64() as i64, 0).unwrap();
let diff = (now - input_time).num_hours();
if diff < 24 {