This is a migrated thread and some comments may be shown as answers.

[Solved] Html.Telerik().DateTimePicker()

4 Answers 33 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Carl
Top achievements
Rank 1
Carl asked on 17 Oct 2012, 11:06 AM
The default time is set to 00:00 when selecting a date from the DateTimePicker, is it possbile to override this in either the creation of the picker at runtime or via jquery?

4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 17 Oct 2012, 02:14 PM
Hi Carl,

You can use something like this:

http://demos.telerik.com/aspnet-mvc/datepicker/clientsideevents

function onChangeDateTimePicker(e) {
    if (!e.previousValue) {
        e.value.setHours(11);
        e.value.setMinutes(15);
        $(this).data("tDateTimePicker").value(e.value);
    }
}


Regards,
Dimo
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
0
Carl
Top achievements
Rank 1
answered on 17 Oct 2012, 02:29 PM
Thanks does the event parameter provide any information on wether the date or time popup activate the event as the time popup should not override the value
0
Accepted
Dimo
Telerik team
answered on 17 Oct 2012, 02:43 PM
Hi,

No, but you can change the IF statement like this:

if (!e.previousValue && !$(this).data("tDateTimePicker").timeView.dropDown.$element.is(":visible")) {
 
}



Regards,
Dimo
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
0
Carl
Top achievements
Rank 1
answered on 18 Oct 2012, 06:53 AM
Prefect thankyou
Tags
Date/Time Pickers
Asked by
Carl
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Carl
Top achievements
Rank 1
Share this question
or