Day.js
perfectly supports internationalization, you just need to import the language package you need from dayjs/locale
, and then pass it to the locale
attribute of the VueDayCalendar
component.
<script setup lang="ts">
import zhcn from 'dayjs/locale/zh-cn'
import VueDayCalendar from 'vue-day-calendar'
</script>
<template>
<VueDayCalendar :locale="zhcn" year-and-month-format="YYYY 年 M 月"/>
</template>
日 | 一 | 二 | 三 | 四 | 五 | 六 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |