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

UX displayFormat issue #3

Open
presencewebdesign opened this issue Feb 3, 2020 · 3 comments
Open

UX displayFormat issue #3

presencewebdesign opened this issue Feb 3, 2020 · 3 comments

Comments

@presencewebdesign
Copy link

presencewebdesign commented Feb 3, 2020

We would like the date to be displayed in this order dmy which works perfectly.
We expect the user to start filling out the date from left to right beginning with the date and month, When the user selects the year the values are all reset which is a bad user experience, the user has to now update the date and month again which will cause frustration.

This has stopped us from using this plugin, how can we resolve this issue?

$("example").dropdownDatepicker({
displayFormat: "dmy"
});

@crallf1sh
Copy link

I had this same issue. When formatting and submitting for MDY every time the user selected a year it would reset Month and Day leaving the user to have to reselect. I fixed this by removing the double check on the date validation starting at line 232. I could be wrong, but that revalidation seems redundant and fixed the issue of the form fields resetting from any order the user may choose.

@junmindereal
Copy link

I had this same issue. When formatting and submitting for MDY every time the user selected a year it would reset Month and Day leaving the user to have to reselect. I fixed this by removing the double check on the date validation starting at line 232. I could be wrong, but that revalidation seems redundant and fixed the issue of the form fields resetting from any order the user may choose.

Could you please share which code are you talking about I checked line 232 and this is the code that I found.

if ($(this).hasClass('month')) {
    $that.clearOptions($daySelect);
    $dayOptions = $that.buildDayOptions(month, year);
    $dayDropdown = $that.addOptionsToDropdown($daySelect, $dayOptions);
    $that.internals.objectRefs.dayDropdown = $dayDropdown;
    if (typeof $that.config.onMonthChange === 'function') {
        $that.config.onMonthChange(day, month, year);
    }
}

Did you remove all the ifs for day, year, and month? Would appreciate your clarification on this. I am encountering the same issue.

Thanks!

@junmindereal
Copy link

I have made a solution to the issue. Will create a pull request later

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

3 participants