RadDateTimePicker not applying dateformat...

6 posts, 0 answers
  1. hll
    hll avatar
    29 posts
    Member since:
    Aug 2008

    Posted 01 Apr 2010 Link to this post

    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?



  2. robertw102
    robertw102 avatar
    265 posts
    Member since:
    Jul 2007

    Posted 01 Apr 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. hll
    hll avatar
    29 posts
    Member since:
    Aug 2008

    Posted 01 Apr 2010 Link to this post

    Because I will be using time part based on users choice....


  5. hll
    hll avatar
    29 posts
    Member since:
    Aug 2008

    Posted 01 Apr 2010 Link to this post

    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...




  6. Jose Santas
    Jose Santas avatar
    4 posts
    Member since:
    Feb 2009

    Posted 06 Jul 2010 Link to this post

    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.
  7. Tristan
    Tristan avatar
    1 posts
    Member since:
    Jul 2010

    Posted 06 Jul 2010 Link to this post

    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''";
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017