summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorwei <>2006-08-30 08:35:39 +0000
committerwei <>2006-08-30 08:35:39 +0000
commitadab65ab49f125b39bf819abe68b0790cbf394df (patch)
tree280c6f994e1341f3915f71805fbcf22e5b059e5d /framework
parentda895b1c97234c9640d94bef0e2027b9fc8a6a66 (diff)
Added TDateTimeStamp class for supporting time stamps outside 1970-2038 using float
Diffstat (limited to 'framework')
-rw-r--r--framework/3rdParty/readme.html29
-rw-r--r--framework/Util/TSimpleDateFormatter.php14
-rw-r--r--framework/Web/UI/WebControls/TDatePicker.php8
3 files changed, 34 insertions, 17 deletions
diff --git a/framework/3rdParty/readme.html b/framework/3rdParty/readme.html
index efa6d411..86021a2e 100644
--- a/framework/3rdParty/readme.html
+++ b/framework/3rdParty/readme.html
@@ -61,21 +61,21 @@ projects.
<td><a href="http://pear.php.net/package/DB">PEAR :: Package :: DB</a></td>
<td><a href="http://www.php.net/license/3_0.txt">PHP License 3.0</a></td>
<td>N.A.</td>
- <td>The parseDSN() function from DB.php file.</td>
+ <td>The parseDSN() function from DB.php file.</td>
</tr>
<tr>
<td><a href="../I18N/core/TCache_Lite.php">../I18N/core/TCache_Lite.php</a></td>
<td><a href="http://pear.php.net/package/Cache_Lite">PEAR :: Package :: Cache_Lite</a></td>
<td><a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></td>
<td>N.A.</td>
- <td>Cache_Lite class was renamed as TCache_Lite for packaging purposes.</td>
+ <td>Cache_Lite class was renamed as TCache_Lite for packaging purposes.</td>
</tr>
<tr>
<td><a href="../I18N/core/Gettext">../I18N/core/Gettext</a></td>
<td><a href="http://pear.php.net/package/File_Gettext">PEAR :: Package :: File_Gettext</a></td>
<td><a href="http://www.php.net/license/3_0.txt">PHP License 3.0</a></td>
<td>N.A.</td>
- <td>File_Gettext, File::Gettext::MO, and File::Gettext::PO</td>
+ <td>File_Gettext, File::Gettext::MO, and File::Gettext::PO</td>
</tr>
<tr>
@@ -83,7 +83,7 @@ projects.
<td><a href="http://pear.php.net/pepr/pepr-proposal-show.php?id=198">Service_JSON proposal</a></td>
<td><a href="http://www.opensource.org/licenses/bsd-license.php">BSD</a></td>
<td>N.A.</td>
- <td>JSON encoder/decoder by Michal Migurski, Matt Knapp and Brett Stimmerman</td>
+ <td>JSON encoder/decoder by Michal Migurski, Matt Knapp and Brett Stimmerman</td>
</tr>
<tr>
@@ -91,21 +91,21 @@ projects.
<td><a href="http://openrico.org/">Rico</a></td>
<td><a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License v2</a></td>
<td>N.A.</td>
- <td>Rico Javascript Library (not yet utilized in Prado)</td>
+ <td>Rico Javascript Library (not yet utilized in Prado)</td>
</tr>
<tr>
<td><a href="../Web/Javascripts/prototype/">../Web/Javascripts/prototype</a></td>
<td><a href="http://dev.rubyonrails.org/browser/spinoffs/prototype">Prototype javascript library</a></td>
<td><a href="../Web/Javascripts/prototype/LICENSE">The Prototype License (MIT based)</a></td>
<td>N.A.</td>
- <td>Core of Prado javascript library.</td>
+ <td>Core of Prado javascript library.</td>
</tr>
<tr>
<td><a href="../Web/Javascripts/extra/logger.js">../Web/Javascripts/extra/logger.js</a></td>
<td><a href="http://gleepglop.com/javascripts/logger/">http://gleepglop.com/javascripts/logger/</a> <a href="http://slayeroffice.com">http://slayeroffice.com</a></td>
<td>None</td>
<td>TJavascriptLogger</td>
- <td>Javascript logger by Corey Johnson. Object Tree by S.G. Chipman.</td>
+ <td>Javascript logger by Corey Johnson. Object Tree by S.G. Chipman.</td>
</tr>
<tr>
@@ -113,7 +113,7 @@ projects.
<td><a href="http://www.JSON.org">http://www.JSON.org</a></td>
<td><a href="http://www.json.org/license.html">MIT based</a></td>
<td>N.A.</td>
- <td>Has "The Software shall be used for Good, not Evil." clause.</td>
+ <td>Has "The Software shall be used for Good, not Evil." clause.</td>
</tr>
<tr>
@@ -122,7 +122,7 @@ projects.
<td><a href="../../demos/quickstart/protected/index/Zend/LICENSE.txt">BSD</a></td>
<td>Quickstart tutorial indexing and search is provided the Zend Lucene search implementation.</td>
<td>This product includes the Zend Framework, freely available at
- http://www.zend.com</td>
+ http://www.zend.com</td>
</tr>
<tr>
@@ -130,9 +130,18 @@ projects.
<td><a href="http://www.michelf.com/projects/php-markdown/">PHP Markdown</a></td>
<td><a href="Markdown/License.text">BSD</a></td>
<td>System.Web.UI.WebControls.TMarkdown</td>
- <td>PHP5 class implementation of the PHP Markdown.</td>
+ <td>PHP5 class implementation of the PHP Markdown.</td>
</tr>
+<tr>
+ <td><a href="../Util">../Util</a></td>
+ <td><a href="http://phplens.com/phpeverywhere/adodb_date_library">ADOdb Date Time Library</a></td>
+ <td><a href="http://phplens.com/phpeverywhere/adodb_date_library">BSD</a></td>
+ <td>System.Util.TDateTimeStamp</td>
+ <td>TimeStamp support for dates outside the 1970-2038.</td>
+</tr>
+
+
</table>
</p>
</body>
diff --git a/framework/Util/TSimpleDateFormatter.php b/framework/Util/TSimpleDateFormatter.php
index 03ae7b7d..9c2975d5 100644
--- a/framework/Util/TSimpleDateFormatter.php
+++ b/framework/Util/TSimpleDateFormatter.php
@@ -168,12 +168,15 @@ class TSimpleDateFormatter
/**
* Gets the time stamp from string or integer.
* @param string|int date to parse
- * @return int parsed date time stamp
+ * @return array date info array
*/
private function getDate($value)
{
- if(is_int($value))
- return @getdate($value);
+ if(!is_string($value))
+ {
+ $s = Prado::createComponent('System.Util.TDateTimeStamp');
+ return $s->getDate($value);
+ }
$date = @strtotime($value);
if($date < 0)
throw new TInvalidDataValueException('invalid_date', $value);
@@ -199,7 +202,7 @@ class TSimpleDateFormatter
*/
public function parse($value,$defaultToCurrentTime=true)
{
- if(is_int($value))
+ if(is_int($value) || is_float($value))
return $value;
else if(!is_string($value))
throw new TInvalidDataValueException('date_to_parse_must_be_string', $value);
@@ -303,7 +306,8 @@ class TSimpleDateFormatter
else
{
$day = intval($day) <= 0 ? 1 : intval($day);
- return @mktime(0, 0, 0, $month, $day, $year);
+ $s = Prado::createComponent('System.Util.TDateTimeStamp');
+ return $s->getTimeStamp(0, 0, 0, $month, $day, $year);
}
}
diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php
index b6daa164..02361e54 100644
--- a/framework/Web/UI/WebControls/TDatePicker.php
+++ b/framework/Web/UI/WebControls/TDatePicker.php
@@ -422,7 +422,9 @@ class TDatePicker extends TTextBox
else
$year = $date['year'];
- $date = @mktime(0, 0, 0, $month, $day, $year);
+ $s = Prado::createComponent('System.Util.TDateTimeStamp');
+ $date = $s->getTimeStamp(0, 0, 0, $month, $day, $year);
+ //$date = @mktime(0, 0, 0, $month, $day, $year);
$pattern = $this->getDateFormat();
$pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern);
@@ -509,7 +511,9 @@ class TDatePicker extends TTextBox
$writer->addAttribute('class', $class);
$writer->renderBeginTag('span');
- $date = @getdate($this->getTimeStampFromText());
+ $s = Prado::createComponent('System.Util.TDateTimeStamp');
+ $date = $s->getDate($this->getTimeStampFromText());
+ //$date = @getdate($this->getTimeStampFromText());
$this->renderCalendarSelections($writer, $date);