users::page, users::created_at, nav gating, icons, misc

This commit is contained in:
2026-03-08 23:50:06 +01:00
parent 8d18c858b3
commit 4a4e97f7be
12 changed files with 129 additions and 18 deletions

View File

@@ -2,6 +2,7 @@ use axum::{
http::StatusCode,
response::{IntoResponse, Response},
};
use chrono::{DateTime, NaiveDate};
use rusqlite::{OptionalExtension, ffi::SQLITE_CONSTRAINT_UNIQUE};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
@@ -101,6 +102,13 @@ impl User {
self.handle = new_handle;
Ok(())
}
pub fn created_at(&self) -> Option<NaiveDate> {
self.id
.get_timestamp()
.and_then(|ts| DateTime::from_timestamp(ts.to_unix().0 as i64, 0))
.map(|dt| dt.date_naive())
}
}
// DANGEROUS: AUTH