summaryrefslogtreecommitdiff
path: root/framework/Util/TSimpleDateFormatter.php
diff options
context:
space:
mode:
authorwei <>2006-04-21 12:58:38 +0000
committerwei <>2006-04-21 12:58:38 +0000
commit3ad074e9410153fefaa2343165a68a355400fd6e (patch)
tree22b5e521f3af9d57bfd07b289201b86e29d1e48e /framework/Util/TSimpleDateFormatter.php
parente392ecbf6e422825083bc7204eacb7090619a47c (diff)
removed exceptions from simple date formatter
Diffstat (limited to 'framework/Util/TSimpleDateFormatter.php')
-rw-r--r--framework/Util/TSimpleDateFormatter.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/framework/Util/TSimpleDateFormatter.php b/framework/Util/TSimpleDateFormatter.php
index 7be49bc9..052e0074 100644
--- a/framework/Util/TSimpleDateFormatter.php
+++ b/framework/Util/TSimpleDateFormatter.php
@@ -246,7 +246,8 @@ class TSimpleDateFormatter
if ($token=='y') { $x=2;$y=4; }
$year = $this->getInteger($value,$i_val,$x,$y);
if(is_null($year))
- throw new TInvalidDataValueException('Invalid year', $value);
+ return null;
+ //throw new TInvalidDataValueException('Invalid year', $value);
$i_val += strlen($year);
if(strlen($year) == 2)
{
@@ -264,7 +265,8 @@ class TSimpleDateFormatter
$this->length($token),2);
$iMonth = intval($month);
if(is_null($month) || $iMonth < 1 || $iMonth > 12 )
- throw new TInvalidDataValueException('Invalid month', $value);
+ return null;
+ //throw new TInvalidDataValueException('Invalid month', $value);
$i_val += strlen($month);
$month = $iMonth;
}
@@ -274,14 +276,16 @@ class TSimpleDateFormatter
$this->length($token), 2);
$iDay = intval($day);
if(is_null($day) || $iDay < 1 || $iDay >31)
- throw new TInvalidDataValueException('Invalid day', $value);
+ return null;
+ //throw new TInvalidDataValueException('Invalid day', $value);
$i_val += strlen($day);
$day = $iDay;
}
else
{
if($this->substring($value, $i_val, $this->length($token)) != $token)
- throw new TInvalidDataValueException("Subpattern '{$this->pattern}' mismatch", $value);
+ return null;
+ //throw new TInvalidDataValueException("Subpattern '{$this->pattern}' mismatch", $value);
else
$i_val += $this->length($token);
}