diff options
author | wei <> | 2006-08-31 03:26:43 +0000 |
---|---|---|
committer | wei <> | 2006-08-31 03:26:43 +0000 |
commit | 9d375f8ef06daea97fbce6c71a8c524aca14d85d (patch) | |
tree | 321eea20981e99f73bfe9b9c133eb23c3e9e2501 | |
parent | 5b2642ffc08dd4c63b196a8208da948c66ff6bec (diff) |
update #351
-rw-r--r-- | framework/Util/TSimpleDateFormatter.php | 3 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TDatePicker.php | 7 | ||||
-rw-r--r-- | tests/FunctionalTests/tickets/protected/pages/Ticket351.page | 1 |
3 files changed, 7 insertions, 4 deletions
diff --git a/framework/Util/TSimpleDateFormatter.php b/framework/Util/TSimpleDateFormatter.php index 9c2975d5..046a3442 100644 --- a/framework/Util/TSimpleDateFormatter.php +++ b/framework/Util/TSimpleDateFormatter.php @@ -118,7 +118,8 @@ class TSimpleDateFormatter $bits['dd'] = str_pad("{$date['mday']}", 2, '0', STR_PAD_LEFT);
$bits['d'] = $date['mday'];
- return str_replace(array_keys($bits), $bits, $this->pattern);
+ $pattern = preg_replace('/M{3,4}/', 'MM', $this->pattern);
+ return str_replace(array_keys($bits), $bits, $pattern);
}
public function getMonthPattern()
diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php index 02361e54..2a9340e5 100644 --- a/framework/Web/UI/WebControls/TDatePicker.php +++ b/framework/Web/UI/WebControls/TDatePicker.php @@ -263,14 +263,15 @@ class TDatePicker extends TTextBox /**
* Sets the date for the date picker using timestamp.
- * @param integer time stamp for the date picker
+ * @param float time stamp for the date picker
*/
public function setTimeStamp($value)
{
- $date = TPropertyValue::ensureInteger($value);
+ $date = TPropertyValue::ensureFloat($value);
$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',
$this->getDateFormat());
- $this->setText($formatter->format($date));
+ $d =$formatter->format($date);
+ $this->setText($d);
}
/**
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket351.page b/tests/FunctionalTests/tickets/protected/pages/Ticket351.page index 5fb65f20..78a7488d 100644 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket351.page +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket351.page @@ -1,6 +1,7 @@ <com:TContent ID="Content">
<com:TDatePicker ID="Birthdate"
DateFormat="MMM/d/yyyy"
+ TimeStamp="-2000000000"
FromYear="1900" UpToYear="1990" InputMode="DropDownList" />
<br />
|