浏览代码

Calendar: fix year month display bug (#15394)

QingDeng 6 年之前
父节点
当前提交
e5c73e8e1b
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      packages/calendar/src/main.vue

+ 2 - 2
packages/calendar/src/main.vue

@@ -146,8 +146,8 @@ export default {
     },
 
     i18nDate() {
-      const year = this.formatedDate.slice(0, 4);
-      const month = this.formatedDate.slice(5, 7).replace('0', '');
+      const year = this.date.getFullYear();
+      const month = this.date.getMonth() + 1;
       return `${year} ${this.t('el.datepicker.year')} ${this.t('el.datepicker.month' + month)}`;
     },