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

How to set display date only have mm/yyyy?

12 Answers 186 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
tungnt185
Top achievements
Rank 2
tungnt185 asked on 27 Jan 2011, 05:54 AM
Hi Telerik team,

I've a question is how to display selecteddate in mm/yyyy format (remove day).
I've already set DateSelectionMode to Month but it's only for selecting a month not for displaying mm/yyyy format.
It's always show 1/mm/yyyy but  I don't want day, I want it's mm/yyyy.
So what's solution for this problem?

Thanks.

12 Answers, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 28 Jan 2011, 10:28 AM
Hello Taufik Hidayat,

This is configurable vie the DateTimeFormat property. Follow the code posted bellow it will help you:

radDateTimePicker.Culture = new System.Globalization.CultureInfo("en-US"
         DateTimeFormat = new System.Globalization.DateTimeFormatInfo 
                      
                            ShortDatePattern = "MM/yyyy" 
                     }
};


Greetings,
Kaloyan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
tungnt185
Top achievements
Rank 2
answered on 08 Feb 2011, 05:07 AM
Thanks Kolayan,

I've configured and it's worked fine.
But there are an error here, Calendar Popup doesn't apply by culture.
It's always is "en-US" culture.
I don't know either this is a problem of control or my own.

Thanks.
0
Kaloyan
Telerik team
answered on 11 Feb 2011, 09:05 AM
Hello Taufik Hidayat,

Sorry for the late response. What culture are you trying to set? The RadCalendar is not supporting some
Asian cultures.

All the best,
Kaloyan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
tungnt185
Top achievements
Rank 2
answered on 15 Feb 2011, 07:45 AM
Hi Kaloyan,

I'm using culture "vi-VN" Vietnamese.
Is it supported by the RadCalendar? And if no so when it's supported?

Regards.

0
Kaloyan
Telerik team
answered on 17 Feb 2011, 04:09 PM
Hello Taufik Hidayat,

The Vietnamese is not currently supported. We have already logged the task in our TFS system.

All the best,
Kaloyan
the Telerik team
0
tungnt185
Top achievements
Rank 2
answered on 18 Feb 2011, 02:15 AM
Thanks Kaloyan,

Could I know which version resolve this problem?
My application really need it asap.

Best regards.
0
Kaloyan
Telerik team
answered on 22 Feb 2011, 10:05 AM
Hi Taufik Hidayat,

Currently there is no estimated timeframe for the development of this feature.

Regards,
Kaloyan
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Yao
Top achievements
Rank 1
answered on 02 Sep 2011, 08:57 AM
HI,ADMIN, 
is supporting zn-CN cultures of RadCalendar?

my code:
               this.dpDate.Culture = new System.Globalization.CultureInfo("zh-CN")
            {
                DateTimeFormat = new System.Globalization.DateTimeFormatInfo { ShortDatePattern = "yyyy-MM" }
            };

but It's always "en-US" culture.

Thanks!
0
Yana
Telerik team
answered on 02 Sep 2011, 01:24 PM
Hi Yao,

I've tested the provided code with the latest version of RadDateTimePicker and it works without a problem at our side, please check the attachment.

All the best,
Yana
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Yao
Top achievements
Rank 1
answered on 05 Sep 2011, 02:19 AM
Thanks Yana, 
 
i'm tested another verison (2011.2.712.1040), but it's the same problem

can you share your demo?

thanks!
0
Ivo
Telerik team
answered on 06 Sep 2011, 01:13 PM
Hello Yao,

Using the DateTimeFormatInfo constructor directly in your application creates date/time information for the invariant culture only. Instead of creating a new instance of DateTimeFormatInfo you should just override some of the values associated with the chosen culture. Here is sample code how this should be done:
this.radDateTimePicker.Culture = new System.Globalization.CultureInfo("zh-CN");
this.radDateTimePicker.Culture.DateTimeFormat.ShortDatePattern = "yyyy-MM";

Sorry for the inconvenience caused.
 
Best wishes,
Ivo
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Yao
Top achievements
Rank 1
answered on 07 Sep 2011, 07:29 AM
thanks,
This problem has been resolved!
Tags
DateTimePicker
Asked by
tungnt185
Top achievements
Rank 2
Answers by
Kaloyan
Telerik team
tungnt185
Top achievements
Rank 2
Yao
Top achievements
Rank 1
Yana
Telerik team
Ivo
Telerik team
Share this question
or