add chinese new year to generic import
authorAlan <alan@roojs.com>
Wed, 3 Apr 2024 06:40:03 +0000 (14:40 +0800)
committerAlan <alan@roojs.com>
Wed, 3 Apr 2024 06:40:03 +0000 (14:40 +0800)
DataObjects/Core_holiday.php
Import/Core_holiday.php
SimpleExcel.php

index 52a13c5..742a240 100644 (file)
@@ -20,7 +20,8 @@ class Pman_Core_DataObjects_Core_holiday extends DB_DataObject
     
     
     static $map = array(
-        'hk' => 'http://www.1823.gov.hk/common/ical/gc/en.ics'
+        'hk' => 'http://www.1823.gov.hk/common/ical/gc/en.ics',
+        'cny' => 'https://raw.githubusercontent.com/andrewlkho/cny.ics/master/cny.ics', // CNY
     );
     
      
index d52306b..e01c11c 100644 (file)
@@ -27,7 +27,7 @@ class Pman_Core_Import_Core_holiday extends Pman_Core_Cli
         DB_DAtaObject::debugLevel(1);
         $d = DB_DataObject::factory('core_holiday');
         $d->updateHolidays('hk');
-        
+        $d->updateHolidays('cny');
     }
     
     function log($str)
index c14257c..0ca12fc 100644 (file)
@@ -410,9 +410,10 @@ class Pman_Core_SimpleExcel extends Pman
             if ( (is_numeric($v) &&  strlen($v) > 1 && substr($v,0,1) == '0' && substr($v,1,1) != '.' )
                     || 
                     $dataFormat == 'string' ) {
+                //var_dump("Write ( {$r}, {$c} ) = " . $v);
                 $worksheet->writeString($start_row+$r, $c, $v, $format);
             } else {
-          
+                //var_dump("Write String ( {$r}, {$c} ) = " . $v);
                 $worksheet->write($start_row+$r, $c, $v, $format);
             }