We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Ejs-datepicker not working in Safari/Firefox when localised

Hi

I have problem with ejs-datepicker in Safari/Firefox browser, when localization is enabled.

When I open popup, and select date from for example last month, then after selecting date returned is wrong - day is correct, but month is not changing. 

For example, open the DatePicker:



select 11 may:


And after click (on 11 may), in date picker is 2020-08-11. Month is wrong.





Here my code:

This is in my _Layout.

This is in my site.js:

function LocalizeEJ2(name) {

ej.base.L10n.load(translations);

function loadCultureFiles() {

ej.base.setCulture(name);

var files = ['ca-gregorian.json', 'numbers.json','timeZoneNames.json'];

if (name != 'en') {
files.push('numberingSystems.json');
}

var loader = ej.base.loadCldr;

var loadCulture = function (prop) {

var val, ajax;

if (name != 'en' && prop === files.length - 1) {
ajax = new ej.base.Ajax(location.origin + '/localization/cldr-data/supplemental/' + files[prop], 'GET', false);
} else {
ajax = new ej.base.Ajax(location.origin + '/localization/cldr-data/main/' + name + '/' + files[prop], 'GET', false);
}
ajax.onSuccess = function (value) {
val = value;
};

ajax.send();

loader(JSON.parse(val));
};
for (var prop = 0; prop < files.length; prop++) {
loadCulture(prop);
}
}

document.addEventListener('DOMContentLoaded', function () {

ej.base.setCulture(name);

loadCultureFiles(name);

});
}

And this is code for control:

<ejs-datepicker id="datepickerfrom" format="yyyy-MM-dd" value="@DateTime.Now.Date">

4 Replies 1 reply marked as answer

TO Tomasz August 28, 2020 10:27 AM UTC

Images are gone, I see, so I attached them in file:

Attachment: Images_5d98f91d.zip


PM Ponmani Murugaiyan Syncfusion Team August 28, 2020 03:10 PM UTC

Hi Tomasz,  

Greetings from Syncfusion support. 

We have validated your reported issue. But unfortunately, the issue is not replicated in our end. We have prepared sample based on your provided code snippet and ensured in Safari and Firefox browser. Please find the sample and video demonstration below for your reference. 

<ejs-datepicker id="datepicker" format="yyyy-MM-dd" value="@DateTime.Now.Date"></ejs-datepicker> 
 
<script> 
    document.addEventListener('DOMContentLoaded', function () { 
        datepicker = document.getElementById('datepicker').ej2_instances[0]; 
        var L10n = ej.base.L10n; 
        L10n.load({ 
            'de': { 
                'datepicker': { 
                    placeholder: 'Wählen Sie ein Datum', 
                    today: 'heute' 
                } 
            } 
        }); 
        loadCultureFiles('de'); 
        ej.base.setCulture('de'); 
 
    }); 
    function loadCultureFiles(name) { 
        var files = ['ca-gregorian.json', 'numbers.json', 'timeZoneNames.json']; 
        if (name === 'ar') { 
            files.push('numberingSystems.json'); 
        } 
        var loader = ej.base.loadCldr; 
        var loadCulture = function (prop) { 
            var val, ajax; 
            if (name === 'ar' && prop === files.length - 1) { 
                ajax = new ej.base.Ajax(location.origin + location.pathname + '/../../cldr-data/supplemental/' + files[prop], 'GET', false); 
            } else { 
                ajax = new ej.base.Ajax(location.origin + location.pathname + '/../../cldr-data/main/' + name + '/' + files[prop], 'GET', false); 
            } 
            ajax.onSuccess = function (value) { 
                val = value; 
            }; 
            ajax.send(); 
            loader(JSON.parse(val)); 
        }; 
        for (var prop = 0; prop < files.length; prop++) { 
            loadCulture(prop); 
        } 
    } 
 
</script> 




Also, we suggest you to upgrade the Syncfusion Nuget version to latest v18.2.0.55 and ensure in your end. 

Kindly check with the above sample and suggestion. If issue still exists please provide the below details. 

  1. Provide Syncfusion Nuget version.
  2. Mention the culture used for localization.
  3. Is the issue replicate in the provided sample. If so please provide the video demonstration for replication procedure.
  4. Try to replicate in the provided sample.

The above requested details will help us to provide you the solution at earliest. 
 
Regards, 
Ponmani M


TO Tomasz September 9, 2020 01:50 PM UTC

I am sorry that I did not write before. I ran an example that you have included, and unfortunately it does not work. I wasn't able to check how the control works at all, because the attached project doesn't effectively run at all. Below is a screen with errors.

Attachment: Screenshot_20200909_at_15.45.00_b685b51d.zip


PM Ponmani Murugaiyan Syncfusion Team September 10, 2020 02:15 PM UTC

Hi Tomasz,  

Sorry for the inconvenience caused.  

The reported issue is a known bug in our end and we have resolved the issue in the Patch release v18.2.57. So please upgrade your package to this version to include the fix.   


Please get in touch with us if you would require any further assistance.  

Regards,  
Ponmani M 


Marked as answer
Loader.
Up arrow icon