mbe — 2012-12-12T04:02:10-05:00 — #1
hi, i try to translate charts of highcharts.com to Jalali Calendar. highchart use unixtime stamp for point and tick position . but when i convert dates to jalali i have a big problem.
current year in jalali is 1391 and current year in Gregorian is 2012 . by default high chart using time stamp so :
var date = new Date() - new Date(1970,01,01,0,0,0,0);
var date = new Date();
and the result is 42 year diffrent between unix timestamp and Gregorian . but in jalali the problem come :
1391 - 1970 = -579 and highchart get error.
how can i fix problem of unixtime stamp and other calandars ?
can i write getTime Method that work with jalali date of 1970 ? (1348,10,11) ?
sorry for my bad english language.
paul_wilkins — 2012-12-12T05:07:35-05:00 — #2
mbe — 2012-12-12T05:14:21-05:00 — #3
you right , at first i convert to jalali with [this . i i only convert date and day and month everything ok but when i convert year to jalali everything go wrong.i need when selection navigation thick yaer in [URL="http://www.highcharts.com/stock/demo/area"]http://www.highcharts.com/stock/demo/area](https://github.com/farhadi/JalaliJSCalendar/blob/master/jalali.js) it show me first month of jalali not first month of Gregorian . so i need to convert years .
paul_wilkins — 2012-12-12T06:01:34-05:00 — #4
Which implies that all you need is to apply a Facade pattern, so that the internal Gregorian dates can be retrieved for display on the page as Jalali dates, and are converted from the displayed Jalali dates to Gregorian dates for the script to use.