summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorctrlaltca <>2013-01-06 23:17:29 +0000
committerctrlaltca <>2013-01-06 23:17:29 +0000
commit4af5784e5c51536e074ea51eacea7e6c79efee15 (patch)
tree3287ab749f097bbc3187bd663487a3ecbd7cd35e /framework
parentea00eb2ea27613491eb517be9659059696fb335b (diff)
backported r3241 to trunk/
Diffstat (limited to 'framework')
-rw-r--r--framework/Util/TDateTimeStamp.php2
-rw-r--r--framework/Util/TSimpleDateFormatter.php5
-rw-r--r--framework/Web/UI/WebControls/TRangeValidator.php2
3 files changed, 6 insertions, 3 deletions
diff --git a/framework/Util/TDateTimeStamp.php b/framework/Util/TDateTimeStamp.php
index f5f76004..90ca73b4 100644
--- a/framework/Util/TDateTimeStamp.php
+++ b/framework/Util/TDateTimeStamp.php
@@ -197,7 +197,7 @@ class TDateTimeStamp
$mon!==false ? $mon : date('m'),
$day!==false ? $day : date('d'));
$dt->setTime($hr, $min, $sec);
- return $dt->format('U');
+ return (int) $dt->format('U');
}
}
diff --git a/framework/Util/TSimpleDateFormatter.php b/framework/Util/TSimpleDateFormatter.php
index a1a1842a..c2fe99b0 100644
--- a/framework/Util/TSimpleDateFormatter.php
+++ b/framework/Util/TSimpleDateFormatter.php
@@ -174,7 +174,10 @@ class TSimpleDateFormatter
private function getDate($value)
{
$s = Prado::createComponent('System.Util.TDateTimeStamp');
- return $s->parseDate($value);
+ if(is_numeric($value))
+ return $s->getDate($value);
+ else
+ return $s->parseDate($value);
}
/**
diff --git a/framework/Web/UI/WebControls/TRangeValidator.php b/framework/Web/UI/WebControls/TRangeValidator.php
index 57538e88..98469e14 100644
--- a/framework/Web/UI/WebControls/TRangeValidator.php
+++ b/framework/Web/UI/WebControls/TRangeValidator.php
@@ -255,7 +255,7 @@ class TRangeValidator extends TBaseValidator
if($dateFormat!=='')
{
$formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $dateFormat);
- $value = $formatter->parse($value, $dateFormat);
+ $value = $formatter->parse($value);
if($minValue!=='')
$valid=$valid && $this->isGreaterThan($value,$formatter->parse($minValue));
if($maxValue!=='')