Avatar of Member_2_7965240
Member_2_7965240
 asked on

Date input localization problem

In our web based software there is a date input which works well in Chrome, Edge and Opera according to localization, but it doesn't work in Firefox and Safari.

As a workaround we built the Modernizr extension like this:
<script>
    $(function(){          
        if (!Modernizr.inputtypes.date) {
            $('input[type=date]').datepicker({
                  dateFormat : 'yy-mm-dd'
                }
             );
        }
    });
</script>

The date shows well with the default value e.g. 2017-11-02 but when the user clicks in it the format changes and it sets a new date (1902 jan. 2).

I attached the pictures

default_value.jpg = Default value
on_focus.jpg = Clicked
after_focus_click.jpg = when it loses focus, without changing the value
on_focus.jpg
after_focus_click.jpg
default_value.jpg
* SafariSoftwareWeb ApplicationsPHPFirefox

Avatar of undefined
Last Comment
Julian Hansen

8/22/2022 - Mon
Julian Hansen

datePicker - is that from jQueryUI or another library?
Member_2_7965240

ASKER
It is from jQueryUI. Thank you.
ASKER CERTIFIED SOLUTION
Julian Hansen

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23