summaryrefslogtreecommitdiff
path: root/framework/Util/TSimpleDateFormatter.php
diff options
context:
space:
mode:
authorknut <>2008-08-05 18:02:53 +0000
committerknut <>2008-08-05 18:02:53 +0000
commit02014e728e09fe672aabb946176492b9ed51606d (patch)
tree22c6baaeeaa8bdb8f9445290604f4f801758fafd /framework/Util/TSimpleDateFormatter.php
parent5cb8bf3a2d0f7d7b9b0b5907a80aee85a8c6f2d9 (diff)
fixed #897
Diffstat (limited to 'framework/Util/TSimpleDateFormatter.php')
-rw-r--r--framework/Util/TSimpleDateFormatter.php13
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 &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 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
}
}
-?>
+?>