Displaying only day and month

9 posts, 0 answers
  1. Ivo
    Ivo avatar
    20 posts
    Member since:
    Mar 2009

    Posted 20 Mar 2009 Link to this post

    Hi,

    Is it possible to display only the day and month using this control?
    I need the user to select an day within an month regardeless of the year.

    Thanks
  2. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 24 Mar 2009 Link to this post

    Hello Ivo,

    First, sorry for the delayed reply!

    Yes, you can change the calendar this way. The year of course matters for the week numbers and week days of a date. If you would like, you can display a single month or display the calendar and remove the year number form the header. Here is how you do this:

    <!--See only one month:--> 
    <input:RadCalendar HeaderVisibility="Collapsed" /> 
     
    <!--See only one year:--> 
    <input:RadCalendar MonthViewHeaderFormat="MMMM" 
            DisplayDateStart="1/1/2009" DisplayDateEnd="12/31/2009" 
            YearViewHeaderFormat='"Current Year"' /> 
     


    Best wishes,
    Miroslav
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. Jack
    Jack avatar
    6 posts
    Member since:
    Jun 2008

    Posted 27 Oct 2009 Link to this post

    HI, we need the same format, and it must display in the input box with the format "dd/MM" no year info.
    Waitting for it, thanks



        Jack
    Insignia.
  5. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 30 Oct 2009 Link to this post

    Hello Jack,

    The the RadDatePicker is using an internal DateTime parser that doesn't support the requested date format. As a workaround you can create a custom ValueConverter which will be used for converting the date format to the desire one. Let us know if you need further assistance. 

    Best wishes,
    Kaloyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Thomas
    Thomas avatar
    1 posts
    Member since:
    Mar 2012

    Posted 16 Mar 2012 Link to this post

    Hi

    Using RadControls for Silverlight, v.2012.1.215.1050 I need a control similar to the RadDatePicker but displaying and selecting only day and month. If possible I would like to also only enter day and month as text.

    The above solution suggested by Miroslav is using RadCalendar. Is there some way to use the RadDatePicker for this ?


    Thanks.
  7. Georgi
    Admin
    Georgi avatar
    349 posts

    Posted 20 Mar 2012 Link to this post

    Hello Thomas,

    I thing the best you can do is set the culture of theDateTimePicker as follow:

    this.DateTimePicker.Culture = new System.Globalization.CultureInfo("en-US");
    this.DateTimePicker.Culture.DateTimeFormat.ShortDatePattern = "dd-MMM";

    Also you can set InputMode="DatePicker" so the only the calendar is visible. As far as removing the Year and the Decade View from the calendar you need to edit its template.

    Greetings,
    Georgi
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  8. Juliana
    Juliana avatar
    71 posts
    Member since:
    Feb 2008

    Posted 17 Jan 2013 Link to this post

    Hi,

    After I assigned format like
    CultureInfo info = new System.Globalization.CultureInfo("en-US");
    info.DateTimeFormat.ShortDatePattern = "ddd M/d/yy";
    dtpTravelDate.Culture = info;

    I got wrong date when typing. See the image attached.
    Is there any way to fix it?
  9. Georgi
    Admin
    Georgi avatar
    349 posts

    Posted 22 Jan 2013 Link to this post

    Hi Juliana,

    What you can try is set formatting to the LongDatePattern :
    CultureInfo info = new System.Globalization.CultureInfo("en-US");
                info.DateTimeFormat.LongDatePattern = "ddd M/d/yy";
                dtpTravelDate.Culture = info;

    Also depending on how you want to display the date in the DateTimePicker you can use DisplayFormat="Long" and DisplayFormat="Short":
    <telerik:RadDateTimePicker InputMode="DatePicker" x:Name="dtpTravelDate" DisplayFormat="Long"/>

    Other possible soulution would be to implement a custom parsing, more info on how to achieve that you can find in this help article. 
    Hope this would help.

    Greetings,
    Georgi
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  10. Juliana
    Juliana avatar
    71 posts
    Member since:
    Feb 2008

    Posted 22 Jan 2013 Link to this post

    Thanks Georgi, long date format solution works fine for me
    Juliana
Back to Top
DevCraft banner