File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -336,11 +336,18 @@ public function getZodiac()
336
336
$ rangeStart = explode ('/ ' , $ range [0 ]);
337
337
$ rangeEnd = explode ('/ ' , $ range [1 ]);
338
338
339
- if (($ month <> intval ($ rangeStart [1 ])) && ($ month <> intval ($ rangeEnd [1 ]))) {
340
- continue ;
341
- }
339
+ $ cd1 = intval ($ rangeStart [0 ]);
340
+ $ cm1 = intval ($ rangeStart [1 ]);
341
+
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 ' );
342
349
343
- if ($ day >= intval ( $ rangeStart [ 0 ]) || $ day <= intval ( $ rangeEnd [ 0 ]) ) {
350
+ if ($ target >= $ min && $ target <= $ max ) {
344
351
$ this ->zodiac = $ data [1 ];
345
352
break ;
346
353
}
You can’t perform that action at this time.
0 commit comments