This is a migrated thread and some comments may be shown as answers.
RadDateTimePicker
3 Answers 7 Views
This is a migrated thread and some comments may be shown as answers.
Kjell
Top achievements
Rank 1
Kjell asked on 21 Jul 2018, 10:35 AM

How set default time like "00:12:00" in RadDateTimePicker?

I have set TimePopupButton-Visible="false" and only want to select the date...

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 24 Jul 2018, 12:14 PM
Hi Kjell,

You can set the input text via the DateInput-DisplayText property:

<telerik:RadDateTimePicker DateInput-DisplayText="00:12:00" ID="RadDateTimePicker1" runat="server" TimePopupButton-Visible="false"></telerik:RadDateTimePicker>

Best regards,
Rumen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Kjell
Top achievements
Rank 1
answered on 25 Jul 2018, 07:27 AM

But unfortunately, the time 12:00 disappears when I choose date?

I want you to choose date but time will be automatically 12:00

0
Rumen
Telerik team
answered on 26 Jul 2018, 01:35 PM
Hi,

Here you are the requested example covering your scenario:

<script type="text/javascript">
    var isTimeSet = false;
 
    function timeSelecting(sender, args) {
        isTimeSet = true;
    }
 
    function dateSelected(sender, args) {
        if (args.get_oldDate() == null && !isTimeSet) {
            args.set_cancel(true);
            isTimeSet = true;
            sender.get_timeView().setTime(12, 0, 0, 0);
        }
        if (isTimeSet) {
            isTimeSet = false;
        }
    }
</script>
<telerik:RadDateTimePicker runat="server" ID="RadDateTimePicker1" TimePopupButton-Visible="false">
    <TimeView runat="server"  OnClientTimeSelecting="timeSelecting"  />
    <ClientEvents OnDateSelected="dateSelected" />
</telerik:RadDateTimePicker>


Regards,
Rumen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Asked by
Kjell
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Kjell
Top achievements
Rank 1
Share this question
or