Added feature #4553: Enable negative timestamps
authorIngmar Schlecht <ingmar.schlecht@typo3.org>
Fri, 22 Feb 2008 10:49:38 +0000 (10:49 +0000)
committerIngmar Schlecht <ingmar.schlecht@typo3.org>
Fri, 22 Feb 2008 10:49:38 +0000 (10:49 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3248 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/jsfunc.evalfield.js

index 7fc2b75..18758de 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2008-02-22  Ingmar Schlecht  <ingmar@typo3.org>
 
        * Added feature #7526: Making loginNews look nicer (Thanks to Steffen Kamper)
+       * Added feature #4553: Enable negative timestamps, so the date/datetime fields now support dates starting from 1902 instead of 1970. This is possible on all platforms since PHP 5.1. (Thanks to Steffen Kamper)
        * Fixed bug #7158: DBAL fixes to Indexed Search backend module (Thanks to Moreno Feltscher)
 
 2008-02-21  Benjamin Mack  <mack@xnos.org>
index 95cb3c9..e4ab1bd 100755 (executable)
@@ -305,7 +305,7 @@ function evalFunc_input(type,inVal) {
                                                add = this.pol(values.valPol[2],this.parseInt(values.values[2]));
                                        }
                                        var year = (values.values[1])?this.parseInt(values.values[1]):this.getYear(today);
-                                       if (  (year>=0&&year<38) || (year>=70&&year<100) || (year>=1970&&year<2038)     )       {
+                                       if (  (year>=0&&year<38) || (year>=70&&year<100) || (year>=1902&&year<2038)     )       {
                                                if (year<100)   {
                                                        year = (year<38) ? year+=2000 : year+=1900;
                                                }
@@ -346,7 +346,7 @@ function evalFunc_input(type,inVal) {
                                        }
 
                                        var year = (values.values[3])?this.parseInt(values.values[3]):this.getYear(today);
-                                       if ( (year>=0&&year<38) || (year>=70&&year<100) || (year>=1970&&year<2038) )    {
+                                       if ( (year>=0&&year<38) || (year>=70&&year<100) || (year>=1902&&year<2038) )    {
                                                if (year<100)   {
                                                        year = (year<38) ? year+=2000 : year+=1900;
                                                }
@@ -364,7 +364,6 @@ function evalFunc_input(type,inVal) {
                                        this.lastDate = this.getTimestamp(theTime);
                        }
                        this.lastDate+=add*24*60*60;
-                       if (this.lastDate<0) {this.lastDate=0;}
                        return this.lastDate;
                break;
                case "time":
@@ -491,4 +490,4 @@ function evalFunc_splitStr(theStr1, delim, index) {
 }
 function evalFunc_getTimestamp(timeObj)        {
        return Date.parse(timeObj)/1000;
-}
\ No newline at end of file
+}