Timezone now CET

This commit is contained in:
2026-05-01 18:11:40 +02:00
parent 4fc1c2eeb8
commit 92fdb87cf0
5 changed files with 44 additions and 5 deletions

35
frontend/Cargo.lock generated
View File

@@ -68,6 +68,16 @@ dependencies = [
"windows-link",
]
[[package]]
name = "chrono-tz"
version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6139a8597ed92cf816dfb33f5dd6cf0bb93a6adc938f11039f371bc5bcd26c3"
dependencies = [
"chrono",
"phf",
]
[[package]]
name = "console_error_panic_hook"
version = "0.1.7"
@@ -116,6 +126,7 @@ name = "frontend"
version = "0.1.0"
dependencies = [
"chrono",
"chrono-tz",
"gloo 0.12.0",
"gloo-net 0.7.0",
"serde",
@@ -735,6 +746,24 @@ version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
[[package]]
name = "phf"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "913273894cec178f401a31ec4b656318d95473527be05c0752cc41cdc32be8b7"
dependencies = [
"phf_shared",
]
[[package]]
name = "phf_shared"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06005508882fb681fd97892ecff4b7fd0fee13ef1aa569f8695dae7ab9099981"
dependencies = [
"siphasher",
]
[[package]]
name = "pin-project"
version = "1.1.11"
@@ -933,6 +962,12 @@ version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]]
name = "siphasher"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e"
[[package]]
name = "slab"
version = "0.4.12"

View File

@@ -24,3 +24,4 @@ yew-router = "0.20.0"
serde_json = "1.0.149"
gloo = "0.12.0"
chrono = { version = "0.4.44", features = ["serde"] }
chrono-tz = "0.10.4"

View File

@@ -1,3 +1,4 @@
use chrono_tz::Europe::Berlin;
use gloo_net::http::Request;
use serde::{Deserialize, Serialize};
use wasm_bindgen::JsCast;
@@ -26,7 +27,7 @@ pub struct Ticket {
pub description: String,
pub room: i16,
pub status: String,
pub date: chrono::NaiveDateTime,
pub date: chrono::DateTime<chrono::Utc>,
pub user_id: i16,
pub user_first_name: String,
pub user_last_name: String,
@@ -310,7 +311,9 @@ pub fn ticket_by_id_component(props: &TicketProps) -> Html {
<p><strong>{ "Betreff: " }</strong>{ &t.betreff }</p>
<p><strong>{ "Beschreibung: " }</strong>{ &t.description }</p>
<p><strong>{ "Raum: " }</strong>{ t.room }</p>
<p><strong>{ "Datum: " }</strong>{ &t.date }</p>
<p><strong>{ "Datum: " }</strong>{
t.date.with_timezone(&Berlin).format("%d.%m.%Y %H:%M:%S").to_string()
}</p>
<p><strong>{ "Status: "}</strong>{ match t.status.as_str() {
"ToDo" => "Zu tun",
"InProgress" => "In Bearbeitung",