From 02014e728e09fe672aabb946176492b9ed51606d Mon Sep 17 00:00:00 2001 From: knut <> Date: Tue, 5 Aug 2008 18:02:53 +0000 Subject: fixed #897 --- framework/Util/TSimpleDateFormatter.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'framework/Util') diff --git a/framework/Util/TSimpleDateFormatter.php b/framework/Util/TSimpleDateFormatter.php index d8bf513a..d0ed4496 100644 --- a/framework/Util/TSimpleDateFormatter.php +++ b/framework/Util/TSimpleDateFormatter.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2008 PradoSoft + * @copyright Copyright © 2005-2008 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Util @@ -305,9 +305,12 @@ class TSimpleDateFormatter if(!$defaultToCurrentTime && ($month === null || $day === null || $year === null)) return null; else - { - $day = intval($day) <= 0 ? 1 : intval($day); - $month = intval($month) <= 0 ? 1 : intval($month); + { + if(empty($year)) { + $year = date('Y'); + } + $day = (int)$day <= 0 ? 1 : (int)$day; + $month = (int)$month <= 0 ? 1 : (int)$month; $s = Prado::createComponent('System.Util.TDateTimeStamp'); return $s->getTimeStamp(0, 0, 0, $month, $day, $year); } @@ -369,4 +372,4 @@ class TSimpleDateFormatter } } -?> +?> -- cgit v1.2.3