27 lines
603 B
Rust
27 lines
603 B
Rust
mod application_error;
|
|
pub mod auth;
|
|
mod date_time_format;
|
|
pub mod event_planning_template;
|
|
pub mod manage_commands;
|
|
pub mod password_change;
|
|
mod template_response_trait;
|
|
pub mod token_generation;
|
|
|
|
#[cfg(test)]
|
|
pub mod test_helper;
|
|
|
|
pub use application_error::ApplicationError;
|
|
pub use date_time_format::DateTimeFormat;
|
|
pub use template_response_trait::TemplateResponse;
|
|
|
|
use chrono::{NaiveDate, Utc};
|
|
|
|
pub fn get_return_url_for_date(date: &NaiveDate) -> String {
|
|
let today = Utc::now().date_naive();
|
|
if date == &today {
|
|
return String::from("/");
|
|
}
|
|
|
|
format!("/?date={}", date)
|
|
}
|