🌐 Add Localization feature

This commit is contained in:
2022-08-21 16:57:06 +02:00
parent 710a07b04b
commit 59a2c0eacb
17 changed files with 301 additions and 123 deletions

View File

@ -6,10 +6,19 @@ import {
fetchHistory,
loading,
} from "../store";
import { dayNames } from "../definitions";
import dayjs from "dayjs";
import ArrowIcon from "./icons/arrow-icon.vue";
const dayNames = [
"days.sunday",
"days.monday",
"days.tuesday",
"days.wednesday",
"days.thursday",
"days.friday",
"days.saturday",
];
function nextDay() {
var newDate = dayjs(selectedDate.value).add(1, "day");
// Skip weekend
@ -35,7 +44,7 @@ async function changeDate(newDate) {
<div class="selector">
<ArrowIcon @click="previousDay" />
<span class="day" @click="changeDate(dayjs())">
{{ dayNames[selectedDay + 1] }},
{{ $t(dayNames[selectedDay + 1]) }},
{{ dayjs(selectedDate).format("DD.MM.YYYY") }}
</span>
<ArrowIcon style="transform: rotate(180deg)" @click="nextDay" />