Fix code style
This commit is contained in:
parent
431a1799fb
commit
ae1b85f961
|
@ -740,13 +740,13 @@ class DateTime
|
||||||
$PHPEndDateObject->modify('+1 year');
|
$PHPEndDateObject->modify('+1 year');
|
||||||
|
|
||||||
// Get the result
|
// Get the result
|
||||||
$retVal = $PHPEndDateObject->diff($PHPStartDateObject)->days;
|
$retVal = $PHPEndDateObject->diff($PHPStartDateObject)->days;
|
||||||
|
|
||||||
// Adjust for leap years cases
|
// Adjust for leap years cases
|
||||||
$isLeapEndYear = $PHPEndDateObject->format('L');
|
$isLeapEndYear = $PHPEndDateObject->format('L');
|
||||||
$limit = new \DateTime($PHPEndDateObject->format('Y-02-29'));
|
$limit = new \DateTime($PHPEndDateObject->format('Y-02-29'));
|
||||||
if (!$isLeapStartYear && !$wasLeapEndYear && $isLeapEndYear && $PHPEndDateObject >= $limit ) {
|
if (!$isLeapStartYear && !$wasLeapEndYear && $isLeapEndYear && $PHPEndDateObject >= $limit) {
|
||||||
$retVal--;
|
--$retVal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -5,31 +5,31 @@ return [
|
||||||
'2016-01-01',
|
'2016-01-01',
|
||||||
'2016-12-31',
|
'2016-12-31',
|
||||||
'YD',
|
'YD',
|
||||||
365
|
365,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'2015-01-01',
|
'2015-01-01',
|
||||||
'2015-12-31',
|
'2015-12-31',
|
||||||
'YD',
|
'YD',
|
||||||
364
|
364,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'2015-01-01',
|
'2015-01-01',
|
||||||
'2016-12-31',
|
'2016-12-31',
|
||||||
'YD',
|
'YD',
|
||||||
364
|
364,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'2016-01-01',
|
'2016-01-01',
|
||||||
'2017-12-31',
|
'2017-12-31',
|
||||||
'YD',
|
'YD',
|
||||||
365
|
365,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'2017-01-01',
|
'2017-01-01',
|
||||||
'2018-12-31',
|
'2018-12-31',
|
||||||
'YD',
|
'YD',
|
||||||
364
|
364,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'ABC',
|
'ABC',
|
||||||
|
|
Loading…
Reference in New Issue