Browse Source

Merge branch 'hotfix/V8-3046'

Vincent GUFFON 3 năm trước cách đây
mục cha
commit
53c4c2b69c
1 tập tin đã thay đổi với 4 bổ sung3 xóa
  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');