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

Function keyUpControls in calendar cause problems for YYYY-DD-MM date format #123

Open
dawid520 opened this issue Jul 27, 2022 · 0 comments

Comments

@dawid520
Copy link

In calendar when readonly is set to false and user can manually enter date, this check doesn't work properly when date format is set to YYYY-MM-DD. When you try enter eg. 2022 calendar automatically set different date.

It works properly when below function will be change from:

var keyUpControls = function(e) {
if (e.target.value && e.target.value.length > 3) {
var test = jSuites.calendar.extractDateFromString(e.target.value, obj.options.format);
if (test) {
obj.setValue(test);
}
}
}

to:

var keyUpControls = function(e) {
if (e.target.value && e.target.value.length == 10) {
var test = jSuites.calendar.extractDateFromString(e.target.value, obj.options.format);
if (test) {
obj.setValue(test);
}
}
}

or dateformat.length instead of 10.

@dawid520 dawid520 changed the title Function keyUpControls in calendar cause a problems for YYYY-DD-MM date format Function keyUpControls in calendar cause problems for YYYY-DD-MM date format Jul 27, 2022
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

1 participant