@@ 692-698 (lines=7) @@ | ||
689 | $retVal = (int) $difference; |
|
690 | ||
691 | break; |
|
692 | case 'M': |
|
693 | $retVal = (int) ($endMonths - $startMonths) + ((int) ($endYears - $startYears) * 12); |
|
694 | // We're only interested in full months |
|
695 | if ($endDays < $startDays) { |
|
696 | --$retVal; |
|
697 | } |
|
698 | ||
699 | break; |
|
700 | case 'Y': |
|
701 | $retVal = (int) ($endYears - $startYears); |
|
@@ 724-733 (lines=10) @@ | ||
721 | } |
|
722 | ||
723 | break; |
|
724 | case 'YM': |
|
725 | $retVal = (int) ($endMonths - $startMonths); |
|
726 | if ($retVal < 0) { |
|
727 | $retVal += 12; |
|
728 | } |
|
729 | // We're only interested in full months |
|
730 | if ($endDays < $startDays) { |
|
731 | --$retVal; |
|
732 | } |
|
733 | ||
734 | break; |
|
735 | case 'YD': |
|
736 | $retVal = (int) $difference; |