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

RadDateTimePicker not applying dateformat...

5 Answers 315 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
hll
Top achievements
Rank 1
hll asked on 01 Apr 2010, 01:55 PM
Hi,
I have a RadDateTimePicker.. I want to edit date format in it.. And I am editing it like the code below;
 <telerik:RadDateTimePicker  AutoPostBackControl="Both" ID="RadTimePicker1" runat="server"
                        <DateInput DisplayDateFormat="dd/MM/yyyy" DateFormat="dd/MM/yyyy"></DateInput>  
                        <TimePopupButton Visible="false" /> 
                 </telerik:RadDateTimePicker> 

When my dateformat is "dd/MM/yyyy" (like the code above) it is still showing time part...
But when I change dateformat and displaydateformat to "MM/dd/yyyy" it hides the time part... It works fine..

But I want to use "dd/MM/yyyy"..

Help please?



5 Answers, 1 is accepted

Sort by
0
robertw102
Top achievements
Rank 1
answered on 01 Apr 2010, 02:38 PM
Why are you using a RadDateTimePicker if you don't want to show the time part and are hiding the TimePopupButton? I would suggest using the RadDatePicker instead.
0
hll
Top achievements
Rank 1
answered on 01 Apr 2010, 03:09 PM
Because I will be using time part based on users choice....


0
hll
Top achievements
Rank 1
answered on 01 Apr 2010, 03:29 PM
I have found the solution....

This does not work;
<telerik:RadDateTimePicker  AutoPostBackControl="Both" ID="RadTimePicker1" runat="server">  
                        <DateInput DisplayDateFormat="dd/MM/yyyy" DateFormat="dd/MM/yyyy"></DateInput>   
                        <TimePopupButton Visible="false" />  
                 </telerik:RadDateTimePicker>  


But this works;
<telerik:RadDateTimePicker  AutoPostBackControl="Both" ID="RadTimePicker1" runat="server">  
                        <DateInput DisplayDateFormat="dd/MM/yyyy " DateFormat="dd/MM/yyyy"></DateInput>   
                        <TimePopupButton Visible="false" />  
                 </telerik:RadDateTimePicker>  

As you can see, the only difference is second one has 'space' at the end of DisplayDateFormat...




0
Marcos
Top achievements
Rank 1
answered on 06 Jul 2010, 01:14 PM
Hi,

I have the same problem, and with the solution that you give, when the picker gets the focus, the time appears again.

I think it could be an issue, because if I use any other dateformat, it works fine.

I hope anyone from Telerik can tell us something.
0
Tristan
Top achievements
Rank 1
answered on 06 Jul 2010, 03:57 PM
Here's a code snippet that works for me. Just add two single quotes to the end of the date time format and the time should now be invisible when out of focus and in focus.

            uiDateTimePicker.DateInput.DisplayDateFormat = "dd.MM.yyyy''";
            uiDateTimePicker.DateInput.DateFormat = "dd.MM.yyyy''";
Tags
Calendar
Asked by
hll
Top achievements
Rank 1
Answers by
robertw102
Top achievements
Rank 1
hll
Top achievements
Rank 1
Marcos
Top achievements
Rank 1
Tristan
Top achievements
Rank 1
Share this question
or