diff options
author | knut <> | 2008-08-05 18:02:53 +0000 |
---|---|---|
committer | knut <> | 2008-08-05 18:02:53 +0000 |
commit | 02014e728e09fe672aabb946176492b9ed51606d (patch) | |
tree | 22c6baaeeaa8bdb8f9445290604f4f801758fafd /framework | |
parent | 5cb8bf3a2d0f7d7b9b0b5907a80aee85a8c6f2d9 (diff) |
fixed #897
Diffstat (limited to 'framework')
-rw-r--r-- | framework/Util/TSimpleDateFormatter.php | 13 |
1 files changed, 8 insertions, 5 deletions
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 <weizhuo[at]gmail[dot]com>
* @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 }
}
-?> +?>
|