ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.09k stars 14.64k forks source link

[Bug Report] el-date-picker component, problems occurs when using “format” attribute with escape characters on type “datetime” #20765

Open JodieShi opened 3 years ago

JodieShi commented 3 years ago

Element UI version

2.11.0

OS/Browsers version

os: win10 browser: chrome 88.0.4324.150

Vue version

2.6.10

Reproduction Link

https://codepen.io/jodieShi/pen/RwoRMmd

Steps to reproduce

  1. binding a el-date-picker with type “datetime” and format "yyyy 年 MM 月 dd 日 HH 时 mm 分 ss 秒"
  2. click to select
  3. select any datetime value, such as: "2021-02-09 00:00:00"

What is Expected?

correct selected value on date and time input correspondingly with expected format. In the case of "2021-02-09 00:00:00", it is expected to be "2021 年 02 月 09 日 " and "00 时 00 分 00 秒" correspondingly.

What is actually happening?

The values of date and time input are "2021 年 02 月 09 日 时 分 秒" and "年 月 日 00 时 00 分 00 秒".

element-bot commented 3 years ago

Translation of this issue:

Element UI version

2.11.0

OS/Browsers version

os: win10 browser: chrome 88.0.4324.150

Vue version

2.6.10

Reproduction Link

https://codepen.io/jodieShi/pen/RwoRMmd

Steps to reproduce

  1. Binding a El date picker with type \"datetime\" and format \"yyyy MM DD HH mm min SS\"

  2. click to select

  3. select any datetime value, such as: \"2021-02-09 00:00:00\"

What is Expected?

correct selected value on date and time input correspondingly with expected format.

In the case of \"2021-02-09 00:00\", it is expected to be \"February 09, 2021\" and \"00:00:00\" responsively

What is actually happening?

The values of date and time input are \"hours, minutes, seconds, February 9, 2021\" and \"hours, minutes, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours, hours

UxieVerity commented 3 years ago

你把“yyyy 年 MM 月 dd 日 HH 时 mm 分 ss 秒”改成“yyyy年MM月dd日 HH时mm分ss秒”就可以了

jiangguangyao commented 3 years ago

什么意思?是希望在时间输入框内编辑的时候也是 XX年XX月XX日 的这种格式么?

UxieVerity commented 3 years ago

什么意思?是希望在时间输入框内编辑的时候也是 XX年XX月XX日 的这种格式么?

你看他发的codepan就知道了

jiangguangyao commented 3 years ago

什么意思?是希望在时间输入框内编辑的时候也是XX年XX月XX日的这种格式么?

你看他发的codepan就知道了

嗯嗯 刚点开,明白了,那就value-format也改成那种格式就行了~~

JodieShi commented 3 years ago

你把“yyyy 年 MM 月 dd 日 HH 时 mm 分 ss 秒”改成“yyyy年MM月dd日 HH时mm分ss秒”就可以了

改完日期变成 "2021年02月09日秒" ,时间变成"日00时00分00秒"这种了

UxieVerity commented 3 years ago

你把“yyyy 年 MM 月 dd 日 HH 时 mm 分 ss 秒”改成“yyyy年MM月dd日 HH时mm分ss秒”就可以了

改完日期变成 "2021年02月09日秒" ,时间变成"日00时00分00秒"这种了

确实有点问题,我大意了

bojun1995 commented 3 years ago

你把“yyyy 年 MM 月 dd 日 HH 时 mm 分 ss 秒”改成“yyyy年MM月dd日 HH时mm分ss秒”就可以了

改完日期变成 "2021年02月09日秒" ,时间变成"日00时00分00秒"这种了

确实有点问题,我大意了

老哥有解决方法不

wenlisu commented 3 years ago

你把“yyyy 年 MM 月 dd 日 HH 时 mm 分 ss 秒”改成“yyyy年MM月dd日 HH时mm分ss秒”就可以了

改完日期变成 "2021年02月09日秒" ,时间变成"日00时00分00秒"这种了

确实有点问题,我大意了

老哥有解决方法不

有人有解决方法吗?

NoraH1to commented 3 years ago

这个问题两年前就遇到过,除此之外还有别的小问题,是不指望有人来维护了..