We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 084d99e commit 821d228Copy full SHA for 821d228
1 file changed
src/Reader.php
@@ -336,11 +336,18 @@ public function getZodiac()
336
$rangeStart = explode('/', $range[0]);
337
$rangeEnd = explode('/', $range[1]);
338
339
- if (($month <> intval($rangeStart[1])) && ($month <> intval($rangeEnd[1]))) {
340
- continue;
341
- }
+ $cd1 = intval($rangeStart[0]);
+ $cm1 = intval($rangeStart[1]);
+
342
+ $cd2 = intval($rangeEnd[0]);
343
+ $cm2 = intval($rangeEnd[1]);
344
345
+ $min = strtotime(date('Y').'-'.$cm1.'-'.$cd1.' 00:00:00');
346
+ $max = strtotime(date('Y').'-'.$cm2.'-'.$cd2.' 00:00:00');
347
348
+ $target = strtotime(date('Y').'-'.$month.'-'.$day.' 00:00:00');
349
- if ($day >= intval($rangeStart[0]) || $day <= intval($rangeEnd[0])) {
350
+ if ($target >= $min && $target <= $max) {
351
$this->zodiac = $data[1];
352
break;
353
}
0 commit comments