diff options
author | wei <> | 2006-08-05 00:38:30 +0000 |
---|---|---|
committer | wei <> | 2006-08-05 00:38:30 +0000 |
commit | 93c4193f4a3c315c7785bf5f9f522c955ef6fce7 (patch) | |
tree | 6166ca58b6a947a0e6fa3cbc9cd728650fc57221 /framework/Web/UI | |
parent | a9bdf9fde29c5bf71d3a402fc15806ca8923aea8 (diff) |
Fixed #274
Diffstat (limited to 'framework/Web/UI')
-rw-r--r-- | framework/Web/UI/WebControls/TBaseValidator.php | 4 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TDataTypeValidator.php | 3 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TDatePicker.php | 3 |
3 files changed, 9 insertions, 1 deletions
diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php index b2405996..bcddfa5f 100644 --- a/framework/Web/UI/WebControls/TBaseValidator.php +++ b/framework/Web/UI/WebControls/TBaseValidator.php @@ -165,6 +165,10 @@ abstract class TBaseValidator extends TLabel implements IValidator $options['ControlCssClass'] = $this->getControlCssClass(); $options['ControlType'] = $this->getClientControlClass($control); + + //get date format from date picker target control + if($control instanceof TDatePicker) + $options['DateFormat'] = $control->getDateFormat(); if(!is_null($this->_clientScript)) $options = array_merge($options,$this->_clientScript->getOptions()); diff --git a/framework/Web/UI/WebControls/TDataTypeValidator.php b/framework/Web/UI/WebControls/TDataTypeValidator.php index bd7569fc..3e91ec15 100644 --- a/framework/Web/UI/WebControls/TDataTypeValidator.php +++ b/framework/Web/UI/WebControls/TDataTypeValidator.php @@ -89,6 +89,9 @@ class TDataTypeValidator extends TBaseValidator */
protected function evaluateDataTypeCheck($value)
{
+ if($value=='')
+ return true;
+
switch($this->getDataType())
{
case 'Integer':
diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php index 6852f9eb..642d9953 100644 --- a/framework/Web/UI/WebControls/TDatePicker.php +++ b/framework/Web/UI/WebControls/TDatePicker.php @@ -296,7 +296,8 @@ class TDatePicker extends TTextBox {
if($this->getText() === '')
return '';
- return $this->getTimeStamp();
+ $date = $this->getTimeStamp();
+ return $date == null ? '' : $date;
}
/**
|