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

DateTimeFormat

5 Answers 152 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Alexandru
Top achievements
Rank 1
Alexandru asked on 21 Mar 2013, 02:37 PM
Hi!

I am trying to customize a DateTimePicker to show the whole date and time in a custom format.
I found a way to customize the ShortdatePattern and the shorttimePattern separatly, but I would really require the FullDateTimePattern to work, as I have the format in a string (date and time combined) and I don't want to split it. I am using Q12013 WFP RadDateTimePicker

            dtp.SelectedValue = DateTime.Now;
            dtp.Culture = new CultureInfo("")
                              {
                                  DateTimeFormat =
                                      {
                                          FullDateTimePattern = "yyyy : MM : dd HH mm ss", //doesn't work
                                          ShortDatePattern = "yyyy : MM : dd", //works
                                          ShortTimePattern = "tt hh::mm::ss", //works
                                      },
                              };

Thanks in advance,
Alex

5 Answers, 1 is accepted

Sort by
0
Alek
Telerik team
answered on 26 Mar 2013, 03:51 PM
Hello Alexandru,

In the current version of the RadDateTimePicker there is no way to set a custom format using FullDateTimePattern.

Unfortunately, we cannot provide you with a workaround for the scenario and if you want to customize the DateTimeFormat you should use ShortDatePattern, ShortTimePattern, LongDatePattern and LondTimePattern instead.

Regards,
Alek
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Alexandru
Top achievements
Rank 1
answered on 27 Mar 2013, 06:36 AM
Thanks!

Could you please tell me if in the next version, 2013Q2, will this feature be implemented?

Alexandru
0
Alek
Telerik team
answered on 29 Mar 2013, 03:15 PM
Hello,

We haven't considered implementing the feature for Q2 2013 so far. 

Could you please share us more information about the scenario in your project and  what difficulties you are facing using the current implementation?

Greetings,
Alek
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Alexandru
Top achievements
Rank 1
answered on 01 Apr 2013, 06:25 AM
Hi!

Customising the datetimepicker format requires the user to alter the Culture object. This object, among other properties, has these 3 formats: FullDateTimePattern, ShortDatePattern and ShortTimePattern.
I think that the control should be able to take into consideration the format from all these 3 properties. If not, than it should have 2 separate properties ShortDatePattern and ShortTimePattern and not give the user the impression it can handle full formatting.
If you consider an application that has a datetimeformat preference as a string, it is not that obvious to extract from it the date and the time formats, taking into consideration that they can appear in any order.
Or can this be done differently?

Thanks,
Alexandru




0
Alek
Telerik team
answered on 04 Apr 2013, 01:58 PM
Hi Alexandru,

Thank you for your feedback.

We are using the DateTimeFormatInfo object for both formatting and parsing the current value. As you correctly noticed this class has a series of properties holding overlapping information like FullDateTimePattern, LongDatePattern, LongTimePattern, ShortTimePattern, ShortDatePattern, SortableDateTimePattern and etc. As we cannot use all of them we decided to use the most comfortable ones for us which are the separate date and time patterns (LongDatePattern, LongTimePattern, ShortTimePattern, ShortDatePattern). They make it easier for us to parse the text written by the user. We decided to use both short and long patterns and to expose a property which allows the user to choose which pair to be used.

Kind regards,
Alek
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
DateTimePicker
Asked by
Alexandru
Top achievements
Rank 1
Answers by
Alek
Telerik team
Alexandru
Top achievements
Rank 1
Share this question
or