iLib-js / iLib

A library of i18n routines written in Javascript.
Apache License 2.0
35 stars 4 forks source link

Persian Calendar Issue #117

Closed gouniLee closed 6 years ago

gouniLee commented 6 years ago

[Info]

If Persian date (year: 1397, month: 1: day,1) It returns, 0.1875 in https://github.com/iLib-js/iLib/blob/development/js/lib/PersianDate.js#L229 line. It should be 0.145833333 That day not in DST time. But iLib says it's in DST time.

Input value is Persian datetime, https://github.com/iLib-js/iLib/blob/development/js/lib/TimeZone.js#L811 value is a bit weird.

Input parameter : PersianCal year:1397, , month:1,  day:1, hour 21: minute 13

var  d = new Date(date ? date.getTimeExtended() + offset: undefined);
new Date(date ? date.getTimeExtended() + offset : undefined);
Thu Mar 22 2018 01:43:17 GMT+0430 ()

More Test on Linux Set time zone for Asia/Iran following steps:

  1. Check current timezone info ls -al /etc/localtime Changed timezone: sudo ln -sf /usr/share/zoneinfo/Asia/Tehran /etrdate -s timebora.netc/localtime Update time :rdate -s timebora.net Check a time with date command
      1. (화) 05:39:02 +0430 <-- Confirmed It's in Iran Timezone.
gouniLee commented 6 years ago

The reposted issue is resolved with aP to https://github.com/iLib-js/iLib/pull/119