calendarengines.js and persian calendar

3 posts, 0 answers
  1. Ali
    Ali avatar
    5 posts
    Member since:
    Aug 2013

    Posted 15 Aug 2013 Link to this post

    Hi dear telerik team
    I bought your source code and hardly tried to change the code of CalendarEngines.js file to change the Gregorian calendar to Jalali(Persian) calendar but I failed because I can't understand some of your variable in this code(like num1,num2 and etc in GetDatePart function). So if you have a JavaScript code for Persian calendar can I ask you to send it for me. I really need it.
    with great thanks.
  2. Vasil
    Vasil avatar
    1604 posts

    Posted 16 Aug 2013 Link to this post

    Hello Ali,

    These variables and the code inside the GetDatePart is used to calculate the proper year, day and month from ticks, taking into account the Leap Years:

    So for example the num1 will give you the days since it is: ticks / this.TicksPerDay.
    Then num2 will be used to keep how many of 400 years there are, to calculate further how many are the leap years, and co on. If you will rewrite the code, you don't actually need to keep this private variables.

    GetDatePartDay is actually the reverse of the GetAbsoluteDate function. See the GetAbsoluteDate function, it is a bit more easier to understand. If the Persian calendar has different calculation of the leap years, you will need to rewrite both GetAbsoluteDate and GetDatePartDay functions.

    On a side note, you said you bought the controls, but I don't see any license linked on your account, if you have any problems with your account and/or sending support tickets, you could contact to our sales department to figure out what is happened.

    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. Ali
    Ali avatar
    5 posts
    Member since:
    Aug 2013

    Posted 19 Aug 2013 Link to this post

    I solved my problem and now I have a PersianRadCalendar.
    with a great thanks to telerik team
Back to Top