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

Calendare Vs Culture Information

6 Answers 60 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Reem
Top achievements
Rank 1
Reem asked on 25 Apr 2013, 09:09 AM
Dears,

thanks for the updates on Service back version, Although I'm facing an issue if I wanted to view the Hijri Calendar I must assign the Culture Info As "ar-sa", while that will convert the calendar to a Hijri Calendar as I want, the problem is that what if I wanted to view this Hijri Calendar with a "En" culture Info, I mean to display these Arabic days & months names into English
Moharram -- 1st Month
Safar -- 2nd Month
.. etc

is that possible, if it's .. how ?

thank in advance for help

6 Answers, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 30 Apr 2013, 08:31 AM
Hello Reem,

Thank you for contacting us.

Yes, it is possible. You need to play more with the CultureInfo object and assign values that you need before you set it to RadCalendar. Here's an example:
CultureInfo arSaCulture = new CultureInfo("ar-SA");
arSaCulture.DateTimeFormat.MonthNames = new string[] { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "" };
arSaCulture.DateTimeFormat.AbbreviatedDayNames = new string[] { "d1", "d2", "d3", "d4", "d5", "d6", "d7" };       
this.calendar.Culture = arSaCulture;
This will create a new CultureInfo object, then modify the month and/or day names and set the adjusted CultureInfo to RadCalendar.

I hope this information helps.

Kind regards,
Todor
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Reem
Top achievements
Rank 1
answered on 01 May 2013, 03:30 AM
Thanks indeed for the continuous support & cooperation, But another big important question is rising ...

the selected date value is always returned in Georgian date even though if the culture information set to the calendar is what so ever, so ... setting the "Displayed date" will always require the Georgian Equivalent Date of the date in other culture I want to show ....

e.g : I want to display date 1-09-1432  in "Ar-sa" culture Calendar .... this will force me to calculate the equivalent date in Georgian then set it to the display date property !!!!

is there any work around or any misunderstanding of this situation that I'm having ?

looking forward to hear from you ...
0
Reem
Top achievements
Rank 1
answered on 01 May 2013, 04:36 AM
thanks for the continuous support & cooperation, We really appreciate that.
as for the Calendar culture info, another big & important issue rises .....

saying that we have set the culture of RadCalendar to "Ar-Sa",,,, or any other ...
we will notice that selected date will always come back in Georgian Date even though that the calendar has different culture ... also setting the display date value will not accept a other than Georgian Date ...


e.g. we want to set the display date to "1-09-1433" .... we are forced to calculate the equivalent Georgian date to that "which is not always matching what the calendar displays" ===> using the calendar API may calculate the equivalent date to 7-7-2012 ... while this date on the calendar will occur as 29-08-1433 .

can't we set the date using the selected culture directly ??

so is there any workaround to avoid that .. or is there any misunderstanding that I've reached regarding that ?

looking forward to hear from you .... thanks for understanding ..
Regards



0
Todor
Telerik team
answered on 03 May 2013, 11:36 AM
Hi Reem,

This behavior is expected, because this is how the DateTime objects work. Think of them not as a specific date (1434, 6, 23), but as a specific period of time (Today). When you want to set the selected date to today, for example, the DateTime object that needs to be set is the same in all possible calendars, but if you want to define it as a period in the HijriCalendar, you need to do this:
this.calendar.SelectedValue = new DateTime(1434, 6, 23, new HijriCalendar());
This way the calendar will be set with the correct value and the result will be the same as setting the selected value with one of these calls:
this.calendar.SelectedValue = new DateTime(2013, 5, 3, new GregorianCalendar());
this.calendar.SelectedValue = new DateTime(2013, 5, 3);

When you get the SelectedValue, you can create a converter that will convert the current DateTime object in the format that you want, but in general it will probably be something similar to this:
if (this.calendar.SelectedValue.HasValue)
{
    string displayValueInSpecificCulture = this.calendar.SelectedValue.Value.ToString(this.calendar.Culture.DateTimeFormat);
}

I hope this information helps.

All the best,
Todor
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Mohamad
Top achievements
Rank 1
answered on 17 Apr 2014, 09:45 AM
hello all

how can i using this Code in asp.net  

hijri calendar 
0
Todor
Telerik team
answered on 22 Apr 2014, 06:49 AM
Hello Mohamad,

This is an old thread regarding RadCalendar for Windows Phone. If you need assistance with RadCalendar for ASP.NET, please refer to its respective forum or submit a support ticket.

Regards,
Todor
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Calendar
Asked by
Reem
Top achievements
Rank 1
Answers by
Todor
Telerik team
Reem
Top achievements
Rank 1
Mohamad
Top achievements
Rank 1
Share this question
or