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

Displaying only day and month

8 Answers 461 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Ivo
Top achievements
Rank 1
Ivo asked on 20 Mar 2009, 12:02 PM
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

8 Answers, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 24 Mar 2009, 08:44 AM
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.
0
Jack
Top achievements
Rank 1
answered on 28 Oct 2009, 01:16 AM
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.
0
Kaloyan
Telerik team
answered on 30 Oct 2009, 03:13 PM
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.
0
Thomas
Top achievements
Rank 1
answered on 16 Mar 2012, 10:33 AM
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.
0
Georgi
Telerik team
answered on 20 Mar 2012, 09:10 AM
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 >>
0
Juliana
Top achievements
Rank 1
answered on 17 Jan 2013, 01:39 PM
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?
0
Georgi
Telerik team
answered on 22 Jan 2013, 08:18 AM
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.

0
Juliana
Top achievements
Rank 1
answered on 22 Jan 2013, 11:42 AM
Thanks Georgi, long date format solution works fine for me
Juliana
Tags
DatePicker
Asked by
Ivo
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Jack
Top achievements
Rank 1
Kaloyan
Telerik team
Thomas
Top achievements
Rank 1
Georgi
Telerik team
Juliana
Top achievements
Rank 1
Share this question
or