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

Month/Year RadDatePicker for Chinese

1 Answer 72 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
savindag
Top achievements
Rank 1
savindag asked on 28 Jan 2010, 11:26 AM
Having a issue with the Month/Year RadDatePicker script provided at http://www.telerik.com/community/code-library/aspnet-ajax/calendar/month-year-picker.aspx. It is working as expected for other cultures except  Chinese.

To reproduce this issue 
1) download the sample and add a Culture="zh-CN" attribute to the RadDatePicker tag
2) Run the project and pick a 2 character month (i.e. Jan-Oct).
The month in the input box changes to Jan always unless a 3 character month is selected (i.e. Nov or Dec)

The issue is in the RadDatInputScript.js at Token.FindIndex where it assumes all the abbreviated month names are at least 3 characters long.

Token.FindIndex=function(_7d,_7e){
if(_7e.length<3){
return -1;
}
for(var i=0;i<_7d.length;i++){
if(_7d[i].toLowerCase().indexOf(_7e)==0){
return i;
}

I changed the condition to check for at least 2 characters instead of 3 but the format of the month in the month/year select popup drops the last character of the 3 character month to the next line. It is not a proper fix but for the moment it seems fine but I would like to have a proper fix.

Thanks

Savinda

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 01 Feb 2010, 09:05 AM
Hello savindag,

The 3 letter condition has been changed to a 2-letter since Q2 2009 SP1 (2009.2.826) - you can try using this version or a newer one.

I am afraid I do not see how the above is related to the month-year dropdown's layout - can you provide an example?

Regards,
Dimo
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.
Tags
Calendar
Asked by
savindag
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or