From 314beb70b2ad2ce05b886bb1bf2743b5dbc0888b Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 16 May 2007 13:02:31 +0000 Subject: [PATCH] "bugfix: for date/time storage formats without separators, eg. Ymd" --- etemplate/inc/class.date_widget.inc.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/etemplate/inc/class.date_widget.inc.php b/etemplate/inc/class.date_widget.inc.php index 7f97dede6f..9f6cccbbcc 100644 --- a/etemplate/inc/class.date_widget.inc.php +++ b/etemplate/inc/class.date_widget.inc.php @@ -120,6 +120,17 @@ $date = split('[- /.:,]',$value); //echo "date=
"; print_r($date); echo "
"; $mdy = split('[- /.:,]',$data_format); + + if (count($mdy) == 1) // no seperators, eg. YmdHi + { + for($n = $i = 0; $n < strlen($data_format); ++$n) + { + $mdy[$n] = $data_format{$n}; + $len = $data_format{$n} == 'Y' ? 4 : 2; + $date[$n] = substr($value,$i,$len); + $i += $len; + } + } $value = array(); foreach ($date as $n => $dat) {