Update
This commit is contained in:
parent
b25c20ab69
commit
075b657f65
2 changed files with 18 additions and 7 deletions
|
@ -31,7 +31,6 @@ pub mod keys {
|
||||||
pub const SUBSTITUTIONS_HTML: &str = "substs_html";
|
pub const SUBSTITUTIONS_HTML: &str = "substs_html";
|
||||||
|
|
||||||
pub mod substitutions {
|
pub mod substitutions {
|
||||||
use chrono::prelude::*;
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
@ -59,13 +58,13 @@ pub mod keys {
|
||||||
#[derive(Deserialize, Serialize, Debug)]
|
#[derive(Deserialize, Serialize, Debug)]
|
||||||
pub struct SubstitutionQuery {
|
pub struct SubstitutionQuery {
|
||||||
#[serde(rename = "d")]
|
#[serde(rename = "d")]
|
||||||
pub date: NaiveDate,
|
pub date: String,
|
||||||
#[serde(rename = "w")]
|
#[serde(rename = "w")]
|
||||||
pub week_type: db::models::WeekType,
|
pub week_type: db::models::WeekType,
|
||||||
#[serde(rename = "q")]
|
#[serde(rename = "q")]
|
||||||
pub queried_at: NaiveDateTime,
|
pub queried_at: String,
|
||||||
#[serde(rename = "i")]
|
#[serde(rename = "i")]
|
||||||
pub last_import_time: NaiveDateTime,
|
pub last_import_time: String,
|
||||||
#[serde(rename = "y")]
|
#[serde(rename = "y")]
|
||||||
pub schoolyear: String,
|
pub schoolyear: String,
|
||||||
#[serde(rename = "t")]
|
#[serde(rename = "t")]
|
||||||
|
|
|
@ -288,10 +288,22 @@ fn cache_substitutions(
|
||||||
.load::<StartEndTime>(db_conn)?;
|
.load::<StartEndTime>(db_conn)?;
|
||||||
|
|
||||||
let query = cache::keys::substitutions::SubstitutionQuery {
|
let query = cache::keys::substitutions::SubstitutionQuery {
|
||||||
date,
|
date: format!(
|
||||||
|
"{} {}",
|
||||||
|
date.format("%d.%m.%Y"),
|
||||||
|
match date.weekday() {
|
||||||
|
chrono::Weekday::Mon => "Montag",
|
||||||
|
chrono::Weekday::Tue => "Dienstag",
|
||||||
|
chrono::Weekday::Wed => "Mittwoch",
|
||||||
|
chrono::Weekday::Thu => "Donnerstag",
|
||||||
|
chrono::Weekday::Fri => "Freitag",
|
||||||
|
chrono::Weekday::Sat => "Samstag",
|
||||||
|
chrono::Weekday::Sun => "Sonntag",
|
||||||
|
}
|
||||||
|
),
|
||||||
week_type,
|
week_type,
|
||||||
queried_at,
|
queried_at: queried_at.format("%d.%m.%Y %R").to_string(),
|
||||||
last_import_time,
|
last_import_time: last_import_time.format("%d.%m.%Y %R").to_string(),
|
||||||
schoolyear: "schoolyear".to_string(),
|
schoolyear: "schoolyear".to_string(),
|
||||||
tenant: "OHG Furtwangen".to_string(),
|
tenant: "OHG Furtwangen".to_string(),
|
||||||
substitutions: db::schema::substitutions::table
|
substitutions: db::schema::substitutions::table
|
||||||
|
|
Loading…
Reference in a new issue