sallar / jDateTime

[UNMAINTAINED] Jalali DateTime Class for PHP
http://sallar.me/projects/jdatetime/
180 stars 61 forks source link

error on calling date by 'W' format string #14

Open mdf092 opened 10 years ago

mdf092 commented 10 years ago

when calling by 'W' format string it returns: index 'z' not define in $temp (line 164): it could be fix by adding these lines: if ($jmonth > 6) { $v = 186 + (($jmonth - 6 - 1) * 30) + $jday; } else { $v = (($jmonth - 1) * 31) + $jday; } self::$temp['z'] = $v; so the final match-case for 'W' is: case 'W': if ($jmonth > 6) { $v = 186 + (($jmonth - 6 - 1) * 30) + $jday; } else { $v = (($jmonth - 1) * 31) + $jday; } self::$temp['z'] = $v; $v = is_int(self::$temp['z'] / 7) ? (self::$temp['z'] / 7) : intval(self::$temp['z'] / 7 + 1); break;

sallar commented 10 years ago

Hi, Thanks! can you do me a favor and fork the repo, fix it and then send a pull request so you can be attributed in the fix?

mdf092 commented 10 years ago

Mission accomplished