Skip to content

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

Open
@dawid520

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions