Shamsi and Persian Scheduler

6 posts, 0 answers
  1. zahed
    zahed avatar
    1 posts
    Member since:
    Jun 2013

    Posted 01 Jun 2015 Link to this post

    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.

  2. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 04 Jun 2015 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Hossein
    Hossein avatar
    3 posts
    Member since:
    Oct 2016

    Posted 30 Oct Link to this post

    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 ... 

  5. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 01 Nov Link to this post

    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.
  6. Hossein
    Hossein avatar
    3 posts
    Member since:
    Oct 2016

    Posted 01 Nov in reply to Dess Link to this post

    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. 

  7. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 02 Nov Link to this post

    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready