Skip to content

Commit

Permalink
Changed way to get current year so value is an integer (as required b…
Browse files Browse the repository at this point in the history
…y the class). PHP's date function is intended for formatting and returns a string type as such.

Signed-off-by: Sacha Telgenhof <[email protected]>
  • Loading branch information
stelgenhof committed Feb 24, 2018
1 parent 82ce112 commit bc23f0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Yasumi/Yasumi.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static function nextWorkingDay(

while ($workingDays > 0) {
$date = $date->add(new \DateInterval('P1D'));
if (! $provider || $provider->getYear() != $date->format('Y')) {
if (! $provider || $provider->getYear() !== \getdate()['year']) {
$provider = self::create($class, $date->format('Y'));
}
if ($provider->isWorkingDay($date)) {
Expand Down Expand Up @@ -285,7 +285,7 @@ public static function prevWorkingDay(

while ($workingDays > 0) {
$date = $date->sub(new \DateInterval('P1D'));
if (! $provider || $provider->getYear() != $date->format('Y')) {
if (! $provider || $provider->getYear() !== \getdate()['year']) {
$provider = self::create($class, $date->format('Y'));
}
if ($provider->isWorkingDay($date)) {
Expand Down

0 comments on commit bc23f0c

Please sign in to comment.