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

Shamsi and Persian Scheduler

5 Answers 213 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Zahed
Top achievements
Rank 1
Zahed asked on 01 Jun 2015, 09:44 PM

hi everyone

 i use Scheduler in  project and i have problem in shamsi Scheduler?

everyting in ok but month is not shamsi 

i use this code

 

private readonly Calendar cal;
private readonly Calendar[] optionals;
 
 
public PersianCulture()
    : this("fa-IR", true)
{
}
 
public PersianCulture(string cultureName, bool useUserOverride)
    : base(cultureName, useUserOverride)
{
    //Temporary Value for cal.
    cal = base.OptionalCalendars[0];
 
    //populating new list of optional calendars.
    var optionalCalendars = new List<Calendar>();
    optionalCalendars.AddRange(base.OptionalCalendars);
    optionalCalendars.Insert(0, new PersianCalendar());
 
 
    Type formatType = typeof(DateTimeFormatInfo);
    Type calendarType = typeof(Calendar);
 
 
    PropertyInfo idProperty = calendarType.GetProperty("ID", BindingFlags.Instance | BindingFlags.NonPublic);
    FieldInfo optionalCalendarfield = formatType.GetField("optionalCalendars",
                                                          BindingFlags.Instance | BindingFlags.NonPublic);
 
    //populating new list of optional calendar ids
    var newOptionalCalendarIDs = new Int32[optionalCalendars.Count];
    for (int i = 0; i < newOptionalCalendarIDs.Length; i++)
        newOptionalCalendarIDs[i] = (Int32)idProperty.GetValue(optionalCalendars[i], null);
 
    optionalCalendarfield.SetValue(DateTimeFormat, newOptionalCalendarIDs);
 
    optionals = optionalCalendars.ToArray();
    cal = optionals[0];
    DateTimeFormat.Calendar = optionals[0];
 
    DateTimeFormat.MonthNames = new[] { "فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند", "" };
    DateTimeFormat.MonthGenitiveNames = new[] { "فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند", "" };
    DateTimeFormat.AbbreviatedMonthNames = new[] { "فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند", "" };
    DateTimeFormat.AbbreviatedMonthGenitiveNames = new[] { "فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند", "" };
 
 
    DateTimeFormat.AbbreviatedDayNames = new string[] { "یکشنبه", "دوشنبه", "ﺳﻪشنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه" };//{ "ی", "د", "س", "چ", "پ", "ج", "ش" };
    DateTimeFormat.ShortestDayNames = new string[] { "یکشنبه", "دوشنبه", "ﺳﻪشنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه" };//{ "ی", "د", "س", "چ", "پ", "ج", "ش" };
    DateTimeFormat.DayNames = new string[] { "یکشنبه", "دوشنبه", "ﺳﻪشنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه" };
 
    DateTimeFormat.AMDesignator = "ق.ظ";
    DateTimeFormat.PMDesignator = "ب.ظ";
 
    /*
    DateTimeFormat.ShortDatePattern = "yyyy/MM/dd";
    DateTimeFormat.LongDatePattern = "yyyy/MM/dd";
          
    DateTimeFormat.SetAllDateTimePatterns(new[] {"yyyy/MM/dd"}, 'd');
    DateTimeFormat.SetAllDateTimePatterns(new[] {"dddd, dd MMMM yyyy"}, 'D');
    DateTimeFormat.SetAllDateTimePatterns(new[] {"yyyy MMMM"}, 'y');
    DateTimeFormat.SetAllDateTimePatterns(new[] {"yyyy MMMM"}, 'Y');
     */
 
}
 
public override Calendar Calendar
{
    get { return cal; }
}
 
public override Calendar[] OptionalCalendars
{
    get { return optionals; }
}

how i fix this problem .

thanks.

5 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 04 Jun 2015, 02:01 PM
Hi Zahed,

Thank you for writing.

RadScheduler provides localization support out of the box. You can find detailed information, a list of the available features and examples in the following section of our documentation: RadScheduler | Localization.

Could you please share in details how exactly you imagine the Shamsi RadScheduler and what features it should incorporate?

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Hossein
Top achievements
Rank 1
answered on 30 Oct 2016, 11:45 AM

Hello.

I used the above code and it looks fine. But, there is a problem with the Month View. the dates are in Georgian date which when I hover it in the tooltip of each day the correct date is shown.

what can I do to fix this issue ?

sample image is attached ... 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 01 Nov 2016, 01:46 PM
Hello Hossein,

Thank you for writing.  

We have a similar issue logged in our feedback portal. However, it had already been addressed in R2 2016 (version 2016.2.503). Here is the feedback item for your reference: https://feedback.telerik.com/Project/154/Feedback/Details/183197-fix-radscheduler-incorrect-day-is-displayed-in-monthview-with-fa-ir-culture

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Hossein
Top achievements
Rank 1
answered on 02 Nov 2016, 04:55 AM

Hello,

Thank you for replying.

What you presented to me is in Telerik Winforms. But, Im using Asp.net components which doesn't have CellFormatting event. such solution could solve my problem. so, I would be thank full if you represent me with Asp.net solution. 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 02 Nov 2016, 06:06 AM
Hello Hossein, 

Thank you for writing back. 

This forum is related to the Telerik UI for WinForms suite. If you have any questions related to the ASP.NET product, feel free to ask the community in the relevant forum: http://www.telerik.com/forums.

I hope this information helps.

Regards,
Dess
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Tags
Scheduler and Reminder
Asked by
Zahed
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Hossein
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or