fix #8131 - chinese translations
[Pman.Core] / DataObjects / Core_holiday.php
index 3a2e9d5..cd26445 100644 (file)
@@ -24,6 +24,22 @@ class Pman_Core_DataObjects_Core_holiday extends DB_DataObject
         'cny' => 'https://raw.githubusercontent.com/andrewlkho/cny.ics/master/cny.ics', // CNY
     );
     
+    
+    function applyFilters($q, $au, $roo)
+    {
+        if (isset($q['date_from'])) {
+            $dt = date("Y-m-d",strtotime($q['date_from']));
+            $this->whereAdd("holiday_date > '$dt'");
+        }
+        if (isset($q['date_to'])) {
+            $dt = date("Y-m-d",strtotime($q['date_to']));
+            $this->whereAdd("holiday_date < '$dt'");
+        }
+        
+        
+    }
+    
+    
      
     function updateHolidays($country)
     {
@@ -73,13 +89,9 @@ class Pman_Core_DataObjects_Core_holiday extends DB_DataObject
                     $fmt = substr($matches[1], 0, 4) . "-" . substr($matches[1], 4, 2) . "-" . substr($matches[1], 6, 2);
                     $end_dt = date('Y-m-d', strtotime($fmt));
                 }
-<<<<<<< Updated upstream
-                
-=======
                 if(preg_match('/^SUMMARY[^:]*:(.*)/', $line, $matches)){
                     $name = trim($matches[1]);
                 }
->>>>>>> Stashed changes
             }
             
             if(empty($start_dt) || empty($end_dt)){
@@ -95,15 +107,13 @@ class Pman_Core_DataObjects_Core_holiday extends DB_DataObject
                 $d->holiday_date = date('Y-m-d', $i);
                 if (!$d->count()) {
                     $d->insert();
-<<<<<<< Updated upstream
-=======
                 } else {
                     $d->find(true);
                     $dd = clone($d);
                     $d->name = $name;
                     $d->update($dd);
->>>>>>> Stashed changes
-                }
+                 }
                 
                 
             }