Skip to content

Commit

Permalink
Merge pull request #69 from wonder-game/develop
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
Joyboo authored Nov 16, 2023
2 parents 3508d1b + eff206e commit 6ea4d14
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/function.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,9 @@ function difdate($beginday, $endday, $format = '%a')
if (is_bool($format)) {
$format = $format === true ? '%a' : '%m';
}
/** @var DateInterval $interval */
$interval = date_diff(date_create($beginday), date_create($endday));
return (int)$interval->format($format);
return $format === '%m' ? (($interval->format('%y') * 12) + $interval->format('%m')) : $interval->format($format);
}
}

Expand Down

0 comments on commit 6ea4d14

Please sign in to comment.