From 114562909f584adfaffe7250f15279deaa9ed8a9 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Thu, 19 Dec 2024 12:12:13 +0100 Subject: [PATCH] update(Calendar.js): uses the user_language for the different day formattings in the calendar views --- public/js/apps/Cis/Stundenplan.js | 2 ++ public/js/components/Calendar/Day/Page.js | 16 +++++++++++----- public/js/components/Calendar/Month.js | 2 +- public/js/components/Calendar/Month/Page.js | 10 +++++++++- public/js/components/Calendar/Months.js | 2 +- public/js/components/Calendar/Week.js | 2 +- public/js/components/Calendar/Week/Page.js | 15 +++++++++++++-- public/js/composables/CalendarDate.js | 4 ++-- public/js/plugin/Phrasen.js | 10 ++++++++++ 9 files changed, 50 insertions(+), 13 deletions(-) diff --git a/public/js/apps/Cis/Stundenplan.js b/public/js/apps/Cis/Stundenplan.js index 1facea322..198e8a765 100644 --- a/public/js/apps/Cis/Stundenplan.js +++ b/public/js/apps/Cis/Stundenplan.js @@ -4,6 +4,7 @@ import CalendarDate from "../../composables/CalendarDate.js"; import LvModal from "../../components/Cis/Mylv/LvModal.js"; import LvInfo from "../../components/Cis/Mylv/LvInfo.js" import LvMenu from "../../components/Cis/Mylv/LvMenu.js" +import Json from "../../helpers/Json.js" const app = Vue.createApp({ @@ -162,4 +163,5 @@ const app = Vue.createApp({ ` }); app.use(Phrasen); +app.component('json', Json); app.mount('#content'); \ No newline at end of file diff --git a/public/js/components/Calendar/Day/Page.js b/public/js/components/Calendar/Day/Page.js index b4d94919f..61d748374 100644 --- a/public/js/components/Calendar/Day/Page.js +++ b/public/js/components/Calendar/Day/Page.js @@ -99,6 +99,13 @@ export default { top: 0, } }, + dayText(){ + if(!this.size || !this.day)return {}; + return { + tag: this.day.toLocaleString(this.$p.user_language_locale_identifier.value, { weekday: this.size < 2 ? 'narrow' : (this.size < 3 ? 'short' : 'long') }), + datum: this.day.toLocaleString(this.$p.user_language_locale_identifier.value, [{ day: 'numeric', month: 'numeric' }, { day: 'numeric', month: 'numeric' }, { day: 'numeric', month: 'numeric' }, { dateStyle: 'short' }][this.size]), + } + }, dayGridStyle() { return { 'grid-template-columns': '1 1fr', @@ -289,15 +296,15 @@ export default { const container = document.getElementById("calendarContainer") if(container) container.style.overflow = 'hidden' }, - template: ` + template: /*html*/`
-
{{day.toLocaleString(undefined, {weekday: size < 2 ? 'narrow' : (size < 3 ? 'short' : 'long')})}}
- {{day.toLocaleString(undefined, [{day:'numeric',month:'numeric'},{day:'numeric',month:'numeric'},{day:'numeric',month:'numeric'},{dateStyle:'short'}][this.size])}} +
{{dayText.tag}}
+ {{dayText.datum}}
@@ -310,7 +317,6 @@ export default { {{hourPositionTime}}
-

Keine Lehrveranstaltungen

@@ -342,7 +348,7 @@ export default {
-
+