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
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
0
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
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
Could you please tell me if in the next version, 2013Q2, will this feature be implemented?
Alexandru
0
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
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
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
Hi Alexandru,
Thank you for your feedback.
Kind regards, Alek
the Telerik team
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.