Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/components/AppHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
:shortcuts="shortcuts"
:show-time-panel="showTimeRangePanel"
:disabled-date="(date, _) => date > new Date()"
:lang="datePickerLang"
@change="handleDateTimeRangeChange"
>
<template v-slot:footer>
Expand Down Expand Up @@ -293,6 +294,7 @@ export default {
},
],
showTimeRangePanel: false,
datePickerLang: null,
};
},
computed: {
Expand Down Expand Up @@ -362,7 +364,20 @@ export default {
this.showTimeRangePanel = false;
},
},
async created() {
const fullLocale = this.$config.locale || "en";
const shortLocale = fullLocale.split("-")[0];
this.datePickerLang = await loadDatepickerLocale(shortLocale);
}
};

async function loadDatepickerLocale(localeCode) {
const supported = ["cs", "da", "de", "es", "fr", "tr", "en"];
if (!supported.includes(localeCode)) {
localeCode = "en";
}
return (await import(`vue2-datepicker/locale/${localeCode}`)).default;
}
</script>

<style lang="scss" scoped>
Expand Down
Loading