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

Display DateTime in custom format (ICustomerFormatter)

2 Answers 64 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
jbssa
Top achievements
Rank 1
jbssa asked on 24 Sep 2010, 09:01 AM
Hi,

I use the RadDatePicker to let the user select a date. Instead of displaying the whole date, only the year and the quarter should be displayed then. I thought of an ICustomerFormatter and IFormatProvider to write a new custom format for the quarter portion of the date. So I have to pass my own format provider to the control. How do I do that? I tried to overwrite RadDatePicker but this seems not enough, because the input control itself is a RadDatePicker-Control.
Any ideas to start with, or is it just the wrong way to achieve the displaying of my own custom format?

2 Answers, 1 is accepted

Sort by
0
Accepted
Iana Tsolova
Telerik team
answered on 29 Sep 2010, 01:18 PM
Hi jbssa,

The DateFormatString of the RadDateInput/RadDatePicker should have all the day, month and year parts. You can use the DisplayDateFormatString property to specify how date would look when the control is out of focus. If this is not applicable for your case, you would better use regular textbox control with RadCalendar for picking dates.

Additionally, you can refer to the below code library projects for further alternatives:
http://www.telerik.com/community/code-library/aspnet-ajax/calendar/how-to-use-raddatepicker-with-a-quot-mm-yyyy-quot-formatted-dateinput.aspx
http://www.telerik.com/community/code-library/aspnet-ajax/calendar/replace-the-dateinput-component-of-r-a-d-datepicker-with-regular-asp-textbox.aspx

All the best,
Iana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
jbssa
Top achievements
Rank 1
answered on 30 Sep 2010, 07:39 AM
Thanks for your reply Iana. I used your suggested solutions with a seperate textfield and display the selected date there with some formatting options.

Thanks!

lG
Jens
Tags
Calendar
Asked by
jbssa
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
jbssa
Top achievements
Rank 1
Share this question
or