From d9dbee3adbdb72ced659f6cd0f8d12028138b15a Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 27 Mar 2017 11:06:54 +0800 Subject: [PATCH] SimpleExcel.php --- SimpleExcel.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SimpleExcel.php b/SimpleExcel.php index 65f126fe..e07fa122 100644 --- a/SimpleExcel.php +++ b/SimpleExcel.php @@ -75,6 +75,7 @@ class Pman_Core_SimpleExcel extends Pman var $workbook = false; var $worksheet= false; + function Pman_Core_SimpleExcel($data,$cfg) { // print_r($cfg);exit; @@ -92,11 +93,14 @@ class Pman_Core_SimpleExcel extends Pman $cfg['formats'] = isset($cfg['formats']) ? $cfg['formats'] : array(); + $this->formats['_default_date_format_'] = $workbook->addFormat();; + $this->formats['_default_date_format_']->setNumFormat('YYYY-MM-DD'); + foreach($cfg['formats'] as $f=>$fcfg) { $this->formats[$f] = & $workbook->addFormat(); foreach((array)$fcfg as $k=>$v) { - $this->formats[$f]->{'set' . $k}($v); + $this->formats[$f]->{'set' . $k}($v); } } -- 2.39.2