element [Bug Report] el-date-picker

lnlaulya  于 2022-10-26  发布在  其他
关注(0)|答案(5)|浏览(309)

Element UI version

2.13.2

OS/Browsers version

win10/Google Chrome 已是最新版本
版本 84.0.4147.105(正式版本) (64 位

Vue version

2.6.10

https://codepen.io/jinggege77/pen/mdVYvaB?editors=1000

Steps to reproduce

使用value-format="yyyy 第 WW 周",显示value1的值,控制台报错
[Vue warn]: Error in render: "TypeError: e.getMonth is not a function"
found in

---> at packages/date-picker/src/picker.vue

[Vue warn]: Error in render: "TypeError: t.getFullYear is not a function"
found in
---> at packages/date-picker/src/basic/year-table.vue

<el-date-picker
  v-model="value1"
  type="week"
  value-format="yyyy 第 WW 周"
  format="yyyy 第 WW 周"
  placeholder="选择周">
</el-date-picker>

What is Expected?

可以修复报错

What is actually happening?

可以修复报错

fhity93d

fhity93d3#

2020年7月份的bug到现在都不解决吗。。。

ldioqlga

ldioqlga4#

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

gjmwrych

gjmwrych5#

Hi, I don't know if anybody still facing the same issue , but I had the same one,
for my case the issue was : when I init the datapicker , and the format was different fromvalue-format

<el-date-picker
                  v-model="value"
                  type="date"
                  placeholder="Pick a day"
                  format="dd/MM/yyyy"
                  value-format="yyyy-MM-dd"
                  :editable="false"
                  ....
                >
                </el-date-picker>

So I had to use the format 'yyyy-MM-dd' for value

相关问题