Skip to content

Commit

Permalink
bug #34203 [FrameworkBundle] [HttpKernel] fixed correct EOL and EOM m…
Browse files Browse the repository at this point in the history
…onth (erics86)

This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #34203).

Discussion
----------

[FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month

Q | A
-- | --
Branch? | 3.4
Bug fix? | yes
New feature? | no
Deprecations? | no
Tickets | -
License | MIT
Doc PR | -

Commits
-------

613717d [FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month
  • Loading branch information
fabpot committed Nov 3, 2019
2 parents 85bcd9d + 613717d commit a1b5079
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Expand Up @@ -123,7 +123,7 @@ private static function formatFileSize($path)

private static function isExpired($date)
{
$date = \DateTime::createFromFormat('m/Y', $date);
$date = \DateTime::createFromFormat('d/m/Y', '01/'.$date);

return false !== $date && new \DateTime() > $date->modify('last day of this month 23:59:59');
}
Expand Down
Expand Up @@ -81,8 +81,8 @@ public function collect(Request $request, Response $response, \Exception $except

$this->data['symfony_state'] = $this->determineSymfonyState();
$this->data['symfony_minor_version'] = sprintf('%s.%s', Kernel::MAJOR_VERSION, Kernel::MINOR_VERSION);
$eom = \DateTime::createFromFormat('m/Y', Kernel::END_OF_MAINTENANCE);
$eol = \DateTime::createFromFormat('m/Y', Kernel::END_OF_LIFE);
$eom = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_MAINTENANCE);
$eol = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_LIFE);
$this->data['symfony_eom'] = $eom->format('F Y');
$this->data['symfony_eol'] = $eol->format('F Y');
}
Expand Down Expand Up @@ -314,8 +314,8 @@ public function getName()
private function determineSymfonyState()
{
$now = new \DateTime();
$eom = \DateTime::createFromFormat('m/Y', Kernel::END_OF_MAINTENANCE)->modify('last day of this month');
$eol = \DateTime::createFromFormat('m/Y', Kernel::END_OF_LIFE)->modify('last day of this month');
$eom = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_MAINTENANCE)->modify('last day of this month');
$eol = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_LIFE)->modify('last day of this month');

if ($now > $eol) {
$versionState = 'eol';
Expand Down

0 comments on commit a1b5079

Please sign in to comment.