fix: availability template not displaying
This commit is contained in:
parent
10468ceba2
commit
e86d38d079
@ -4,7 +4,7 @@ use serde::Deserialize;
|
||||
|
||||
use crate::filters;
|
||||
use crate::models::{Availability, AvailabilityChangeset, Role, User};
|
||||
use crate::utils::DateTimeFormat::{DayMonth, DayMonthYear, DayMonthYearHourMinute};
|
||||
use crate::utils::DateTimeFormat::{DayMonth, DayMonthYear, DayMonthYearHourMinute, HourMinute};
|
||||
|
||||
pub mod delete;
|
||||
pub mod get_new;
|
||||
|
@ -2,6 +2,7 @@ use std::fmt::Display;
|
||||
|
||||
use chrono::{NaiveDate, NaiveDateTime, NaiveTime};
|
||||
use maud::html;
|
||||
use tracing::trace;
|
||||
|
||||
use crate::{models::UserFunction, utils::DateTimeFormat};
|
||||
|
||||
@ -74,13 +75,22 @@ pub fn show_tree(f: &UserFunction) -> askama::Result<String> {
|
||||
}
|
||||
|
||||
pub fn fmt_date(v: &NaiveDate, format: DateTimeFormat) -> askama::Result<String> {
|
||||
Ok(v.format(format.into()).to_string())
|
||||
let format_string = format.into();
|
||||
trace!(format=format_string, "formatting naivedate into string with format");
|
||||
|
||||
Ok(v.format(format_string).to_string())
|
||||
}
|
||||
|
||||
pub fn fmt_datetime(v: &NaiveDateTime, format: DateTimeFormat) -> askama::Result<String> {
|
||||
Ok(v.format(format.into()).to_string())
|
||||
let format_string = format.into();
|
||||
trace!(format=format_string, "formatting naivedatetime into string with format");
|
||||
|
||||
Ok(v.format(format_string).to_string())
|
||||
}
|
||||
|
||||
pub fn fmt_time(v: &NaiveTime, format: DateTimeFormat) -> askama::Result<String> {
|
||||
Ok(v.format(format.into()).to_string())
|
||||
let format_string = format.into();
|
||||
trace!(format=format_string, "formatting naivetime into string with format");
|
||||
|
||||
Ok(v.format(format_string).to_string())
|
||||
}
|
||||
|
@ -81,9 +81,9 @@
|
||||
</svg>
|
||||
{% let start_time = start.unwrap_or(NaiveTime::from_hms_opt(10, 0, 0).unwrap()) %}
|
||||
{% let end_time = start.unwrap_or(NaiveTime::from_hms_opt(20, 0, 0).unwrap()) %}
|
||||
verfügbar von {{ date|fmt_date(DayMonth) }} <span id="st">{{ start_time|fmt_time(DayMonth) }}</span> Uhr
|
||||
verfügbar von {{ date|fmt_date(DayMonth) }} <span id="st">{{ start_time|fmt_time(HourMinute) }}</span> Uhr
|
||||
bis <span id="ed">{{ enddate.as_ref().unwrap_or(date)|fmt_date(DayMonth) }}</span>
|
||||
<span id="et">{{ end_time|fmt_time(DayMonth) }}</span> Uhr
|
||||
<span id="et">{{ end_time|fmt_time(HourMinute) }}</span> Uhr
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user