Переделан знак зодиака на более точный
This commit is contained in:
parent
70c8a6959e
commit
be6b2e61da
@ -2027,13 +2027,15 @@ function star_sign($date)
|
|||||||
$zodiac[51] = "12";
|
$zodiac[51] = "12";
|
||||||
$zodiac[20] = "11";
|
$zodiac[20] = "11";
|
||||||
$zodiac[0] = "10";
|
$zodiac[0] = "10";
|
||||||
$dayOfYear = date("z", $date);
|
$dayOfYear = (int)date("z", $date);
|
||||||
$isLeapYear = date("L", $date); //Высокосный?
|
$isLeapYear = (int)date("L", $date); //Высокосный?
|
||||||
if ($isLeapYear && $dayOfYear >59) {
|
if ($isLeapYear && $dayOfYear >59) {
|
||||||
$dayOfYear = $dayOfYear - 1;
|
--$dayOfYear;
|
||||||
}
|
}
|
||||||
foreach ($zodiac as $day => $sign) {
|
foreach ($zodiac as $day => $sign) {
|
||||||
if ($dayOfYear > $day) break;
|
if ($dayOfYear > $day) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $sign;
|
return $sign;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user