Improve life calendar and add it to header
This commit is contained in:
@ -9,8 +9,10 @@ use crate::auth::MasterPassword;
|
||||
use crate::database::migrations::migrate;
|
||||
use crate::database::unversioned::global::schema_version;
|
||||
use crate::database::SCHEMA_VERSION;
|
||||
use crate::routes::pages::weeks::BirthDate;
|
||||
use crate::util::EventNotifier;
|
||||
use bincode::{deserialize, serialize};
|
||||
use chrono::NaiveDate;
|
||||
use dotenv::dotenv;
|
||||
use rocket_contrib::serve::StaticFiles;
|
||||
use rocket_contrib::templates::Template;
|
||||
@ -29,6 +31,10 @@ async fn main() -> io::Result<()> {
|
||||
})
|
||||
.into();
|
||||
|
||||
let birth_date: BirthDate = env::var("BIRTH_DATE")
|
||||
.map(|s| BirthDate(s.parse().expect("failed to parse BIRTH_DATE")))
|
||||
.unwrap_or_else(|_| BirthDate(NaiveDate::from_ymd(2000, 1, 1)));
|
||||
|
||||
let mut sled = sled::open(db_path)?;
|
||||
match sled.insert(
|
||||
serialize(schema_version::K).unwrap(),
|
||||
@ -56,6 +62,7 @@ async fn main() -> io::Result<()> {
|
||||
}))
|
||||
.manage(sled)
|
||||
.manage(master_pass)
|
||||
.manage(birth_date)
|
||||
.manage(EventNotifier::new())
|
||||
.mount("/static", StaticFiles::from("static"))
|
||||
.mount(
|
||||
|
||||
Reference in New Issue
Block a user