Adjusted monthly quotas plugin to use configurable holidays.
[timetracker.git] / WEB-INF / lib / form / Calendar.class.php
index 6c4a422..d3845e8 100644 (file)
@@ -171,16 +171,11 @@ class Calendar extends FormElement {
               $stl_cell = ' class="CalendarDay"';
             }
 
-              // holidays
-              //if ($this->showHolidays) {
-              global $user;
-              if ($user->show_holidays) {
-              foreach ($this->holidays as $day) {
-                if($day == $date) {
-                  $stl_cell = ' class="CalendarDayHoliday"';
-                  $stl_link = ' class="CalendarLinkHoliday"';
-                }
-              }
+            // holidays
+            $date_to_check = ttTimeHelper::dateInDatabaseFormat($thisyear, $thismonth, $start_date+$j);
+            if (ttTimeHelper::isHoliday($date_to_check)) {
+              $stl_cell = ' class="CalendarDayHoliday"';
+              $stl_link = ' class="CalendarLinkHoliday"';
             }
 
             // selected day