Browse Source

Merge branch 'hotfix/V8-3046'

Vincent GUFFON 3 years ago
parent
commit
53c4c2b69c
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/Service/Organization/Utils.php

+ 4 - 3
src/Service/Organization/Utils.php

@@ -76,11 +76,12 @@ class Utils
      * @see UtilsTest::testGetOrganizationCurrentActivityYear()
      */
     public static function getOrganizationCurrentActivityYear(Organization $organization): int{
-        $musicalDate = $organization->getParameters()->getMusicalDate();
-        if(empty($musicalDate)) $musicalDate = new \DateTime('now');
-
         $today = new \DateTime();
         $year = intval($today->format('Y'));
+
+        $musicalDate = $organization->getParameters()->getMusicalDate();
+        if(empty($musicalDate)) $musicalDate = new \DateTime($year.'-08-31');
+
         $base_date = new \DateTime($musicalDate->format($year.'-m-d'));
         $dateStart = new \DateTime($year . '-01-01');