Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] Can not set the 12-hour time format in DateTimePicker #6537

Closed
forevist opened this issue Aug 16, 2017 · 1 comment
Closed

[Bug Report] Can not set the 12-hour time format in DateTimePicker #6537

forevist opened this issue Aug 16, 2017 · 1 comment

Comments

@forevist
Copy link

Element UI version

1.4.2

OS/Browsers version

Win10 / Chrome version 60.0.3112.90

Vue version

2.4.2

Reproduction Link

https://jsfiddle.net/pj71jkyw/

Steps to reproduce

Set fromat 'dd-MM-yyyy HH:mm a'
and try chose some date range

What is Expected?

i expect result like "16-08-2017 06:19 pm"

What is actually happening?

Actually look at the console, and you will see critical error: "TypeError: Cannot read property '0' of undefined"

because in "

fecha.format = function (dateObj, mask, i18nSettings) {
"

in fecha.format function (line 251)
we could see:
var i18n = i18nSettings || fecha.i18n;

but in i18nSettings

"

const getI18nSettings = () => {
"

settings doesn't have amPm to convert like in code

(

a: [word, function (d, v, i18n) {
):

a: [word, function (d, v, i18n) {
var val = v.toLowerCase();
if (val === i18n.amPm[0]) {
d.isPm = false;
} else if (val === i18n.amPm[1]) {
d.isPm = true;
}
}],

@Leopoldthecoder
Copy link
Contributor

Fixed in #6574

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants