summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwei <>2006-11-19 00:18:00 +0000
committerwei <>2006-11-19 00:18:00 +0000
commit415625e02d5661588a18ac21b789bc0107bd1761 (patch)
treea9ce3155d59985f08b46a33f6acfea611483c011
parente2b765792fd664cc45c2cc9f686f2b4988b80148 (diff)
Fix #453
-rw-r--r--.gitattributes3
-rw-r--r--framework/I18N/core/DateFormat.php8
-rw-r--r--framework/Util/TDateTimeStamp.php2
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket283.page18
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket283.php11
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket453.page3
6 files changed, 43 insertions, 2 deletions
diff --git a/.gitattributes b/.gitattributes
index 8ff63f45..049a9856 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1711,6 +1711,8 @@ tests/FunctionalTests/tickets/protected/pages/Ticket278.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket278.php -text
tests/FunctionalTests/tickets/protected/pages/Ticket28.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket28.php -text
+tests/FunctionalTests/tickets/protected/pages/Ticket283.page -text
+tests/FunctionalTests/tickets/protected/pages/Ticket283.php -text
tests/FunctionalTests/tickets/protected/pages/Ticket284.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket284.php -text
tests/FunctionalTests/tickets/protected/pages/Ticket284Component.php -text
@@ -1720,6 +1722,7 @@ tests/FunctionalTests/tickets/protected/pages/Ticket306.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket311.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket312.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket351.page -text
+tests/FunctionalTests/tickets/protected/pages/Ticket453.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket54.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket54Master.php -text
tests/FunctionalTests/tickets/protected/pages/Ticket54Master.tpl -text
diff --git a/framework/I18N/core/DateFormat.php b/framework/I18N/core/DateFormat.php
index 142926f4..8dd3fdca 100644
--- a/framework/I18N/core/DateFormat.php
+++ b/framework/I18N/core/DateFormat.php
@@ -110,13 +110,17 @@ class DateFormat
*/
public function format($time, $pattern='F', $charset='UTF-8')
{
- if(is_string($time))
+ if (is_numeric($time)) //assumes unix epoch
+ $time = floatval($time);
+ else if(is_string($time))
$time = @strtotime($time);
if(is_null($pattern))
$pattern = 'F';
- $date = @getdate($time);
+ $s = Prado::createComponent('System.Util.TDateTimeStamp');
+
+ $date = $s->getDate($time);
$pattern = $this->getPattern($pattern);
diff --git a/framework/Util/TDateTimeStamp.php b/framework/Util/TDateTimeStamp.php
index 9949b837..ab49470f 100644
--- a/framework/Util/TDateTimeStamp.php
+++ b/framework/Util/TDateTimeStamp.php
@@ -194,6 +194,8 @@ class TDateTimeStamp
return $this->_getDateInternal($d);
}
+
+
/**
* Low-level function that returns the getdate() array. We have a special
* $fast flag, which if set to true, will return fewer array values,
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket283.page b/tests/FunctionalTests/tickets/protected/pages/Ticket283.page
new file mode 100644
index 00000000..b5e1f95b
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket283.page
@@ -0,0 +1,18 @@
+<com:TContent ID="Content">
+
+<com:TPanel DefaultButton="button1">
+Panel 1
+<com:TTextBox />
+<com:TButton ID="button1" Text="Button 1" OnClick="button_clicked" />
+</com:TPanel>
+
+<com:TPanel DefaultButton="button2">
+Panel 2
+<com:TTextBox />
+<com:TButton ID="button2" Text="Button 2" OnClick="button_clicked" />
+</com:TPanel>
+
+<com:TLabel ID="label1" />
+
+</com:TContent>
+
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket283.php b/tests/FunctionalTests/tickets/protected/pages/Ticket283.php
new file mode 100644
index 00000000..8426eae4
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket283.php
@@ -0,0 +1,11 @@
+<?php
+
+class Ticket283 extends TPage
+{
+ function button_clicked($sender, $param)
+ {
+ $this->label1->Text = $sender->Text.' Clicked!';
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket453.page b/tests/FunctionalTests/tickets/protected/pages/Ticket453.page
new file mode 100644
index 00000000..23905aea
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket453.page
@@ -0,0 +1,3 @@
+<com:TContent ID="Content">
+<com:System.I18N.TDateFormat Value="-19200000000" />
+</com:TContent> \ No newline at end of file