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

Cannot change value of DateTimePicker in locale format

I have two DateTimePickers that need to talk together, but I am having problem programatically changing the values of them.
If I try to set the value of a DateTimePicker to "27/11/2019 16:00" the input-field of the picker is cleared and the watermark text is shown.
If I instead use "27-11-2019 16:00" the value is displayed correctly, but this is not the format defined for the control and this is not the format I want to display to the user. The displayed format reverts correctly if I change the date in the control with user input.

I have my DateTimePickers set up with the following rules:

$('#StartDate').ejDateTimePicker({
            locale: "da-DK",
            dateTimeFormat: "dd/MM/yyyy HH:mm",
            width: "auto",
            height: 35,
            value: $('#StartDate').attr("defaultvalue"),
            watermarkText: "Vælg",
            buttonText: {
                timeNow: "Klokken nu"
            },
            change: DateTimePickerChanged,
            focusIn: DateTimePickerFocused
        });

function DateTimePickerFocused(args) {
       var dateObj = $('#' + args.model.name).ejDateTimePicker('instance');
       dateObj.show();
}

function DateTimePickerChanged(args) {
    // the newly selected date may invalidate the other datetimepicker control
    // in that case, change the value of the other control
    // ... code omitted

   $(selector).ejDateTimePicker({ value: '27/11/2019 16:00'});  // setting this value on a datetimepicker fails   
            
}


2 Replies

KR Keerthana Rajendran Syncfusion Team November 29, 2019 09:09 AM UTC

  
Hi Toke, 
 
Greetings from Syncfusion support.  
 
We have validated your reported problem “Unable to change the value of DateTimePicker with locale formatand confirmed this as a defect in our end. We will fix this issue and include in our Volume 4, SP1 release which is expected to be rolled out by the month of January 2020. We appreciate your patience until then.  
 
You can track the status from the below feedback portal link.  
 
 
Regards, 
Keerthana.  
 



SA Shameer Ali Baig Sulaiman Ali Baig Syncfusion Team January 31, 2020 11:04 AM UTC

Hi Toke, 
 
Sorry for the inconvenience. 
 
Due to some technical complexities, we are unable to include this fix in 2019 Vol4 SP1 release. 
 
Fix for this issue will be included in Volume 1 main release which is expected to be rolled out at the end of March 2020. 
 
However, we have prepared a custom patch with the fix for the reported issue in DateTimePicker component. Please, make use of them to resolve the reported issue at your end. 
 
HTTP Link: 
 
 
HTTP Link (Nuget): 
 
 
We will appreciate your patience till then. 
 
Regards, 
Shameer Ali Baig S. 


Loader.
Live Chat Icon For mobile
Up arrow icon