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
close icon

2 questions for DateTimePicker

I have 2 questions for DateTimePicker:

1. When the value is oblivious to what is the date , and always puts the current date.

DateTime dt = new DateTime(2016,3,4,13,22);
@Html.EJ().DateTimePicker("DATE_START").DateTimeFormat("dd.MM.yyyy HH:mm").Value(dt)


2. I have a page that present 2 DateTimePicker and a button to open the Dialog. When open the Dialog in Ajax mode and his subsequent closing , DateTimePicker clears specified dates and does not show anything.



thank you

4 Replies

GS Gobalakrishnan S Syncfusion Team March 1, 2016 02:47 PM UTC

Hi Emil Yotov,
Query: Value is oblivious to what is the date, and always puts the current date.

We were able to reproduce the problem and we considered “The datetimepicker control displays only the current date” as bug. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents


Query:  DateTimePicker clears specified dates and does not show anything.

We have analyzed your query, the reported issue may be caused if you have to rendered the DateTimePicker control in unobtrusive mode, and used the “ej.widget.init ()” to initialize the datetimepicker control in the Ajax Success. 

If you are using the “ej.widget.init ()” method, then it should be called only at the initial time of dialog open only .no need to initialize the widgets whenever the open is triggered.  So in this case, we can maintain the flag variable to identify the initial rendering and prevent the multiple execution of “ej.widget.init ()” method to resolve this issue. We have prepared the sample based on your requirement please find the sample on below location.

http://www.syncfusion.com/downloads/support/forum/123242/ze/MvcApp11244903495

Whether you are mentioned this issue? Or any other issue. If we have misunderstood means, please provide the more details about the issue with code snippet. This will help us to provide the exact solution to resolve your issue.

Please let me know, if you have mentioned concern

Regards,

Gobalakrishnan S



EY Emil Yotov March 1, 2016 03:20 PM UTC

I use “ej.widget.init ()” to initialize the datetimepicker control in the Ajax Success. 

    var initial = true;
    function onSuccess(args) {
        if (initial)
        {
            ej.widget.init();
        }
    }


I put initial var in main code.
In main code DATETIME PICKER is in Index.cshtml file, not in Dialog. In Dialog a have use other Syncfusion control twat show well. Problem is re-initialization on controls in Index.cshtml where is DATETIME PICKERS /or other controls/.
How to prevent re-init on control in Index.cshtml after close dialog?


EY Emil Yotov March 1, 2016 04:41 PM UTC

Hi,
Problem solved.

 var initial = true;
    function onSuccess(args) {
        if (initial)
        {
            ej.widget.init($("#div_relation_all"));  
        }


Thanks.



SS Selvamani Sankarappan Syncfusion Team March 2, 2016 08:47 AM UTC

Hi Emil,

Thanks for the update,

Please let us know, if you need any further assistance. We will be happy to help you.

Regards,

Selvamani S


Loader.
Live Chat Icon For mobile
Up arrow icon