users::page, users::created_at, nav gating, icons, misc
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user