summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2007-03-04 02:15:03 +0000
committerxue <>2007-03-04 02:15:03 +0000
commit5235271e1871d5cbedc852c5508c540a7143fc8d (patch)
treecf81adcf6717a106e48c4e8800fe16d204beef5c
parent902639d85f9ca13e54e04f9d2a59c691d4610195 (diff)
Fixed #549.
-rw-r--r--HISTORY1
-rw-r--r--framework/Web/UI/WebControls/TDatePicker.php20
2 files changed, 14 insertions, 7 deletions
diff --git a/HISTORY b/HISTORY
index e252289e..267f350f 100644
--- a/HISTORY
+++ b/HISTORY
@@ -3,6 +3,7 @@ Version 3.1.0 beta to be released
BUG: Ticket#492 - TDataGridPagerStyle not found error (Qiang)
BUG: Ticket#517 - Quickstart I18N sample: conflicting module ID (Wei)
BUG: Ticket#521 - comment tag on TActiveButton stop callback (Wei)
+BUG: Ticket#549 - set/get Timestamp on TDatePicker shound handle "null" values (Qiang)
BUG: Ticket#553 - I18N quickstart sample does not work (Qiang)
BUG: TXmlElement did not encode attribute and text values when being saved as a string (Qiang)
BUG: SelectedIndices not return expected result for ActiveListBox (Wei)
diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php
index 1d7f780b..ca52523d 100644
--- a/framework/Web/UI/WebControls/TDatePicker.php
+++ b/framework/Web/UI/WebControls/TDatePicker.php
@@ -260,11 +260,14 @@ class TDatePicker extends TTextBox
}
/**
- * @return integer current selected date from the date picker as timestamp.
+ * @return integer current selected date from the date picker as timestamp, NULL if timestamp is not set previously.
*/
public function getTimeStamp()
{
- return $this->getTimeStampFromText();
+ if(trim($this->getText())==='')
+ return null;
+ else
+ return $this->getTimeStampFromText();
}
/**
@@ -273,11 +276,14 @@ class TDatePicker extends TTextBox
*/
public function setTimeStamp($value)
{
- $date = TPropertyValue::ensureFloat($value);
- $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',
- $this->getDateFormat());
- $d =$formatter->format($date);
- $this->setText($d);
+ if($value===null || (is_string($value) && trim($value)==='')
+ $this->setText('');
+ else
+ {
+ $date = TPropertyValue::ensureFloat($value);
+ $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$this->getDateFormat());
+ $this->setText($formatter->format($date));
+ }
}
/**