[BUGFIX] Date of 1970-01-01 is shown in unset date fields
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_befunc.php
index 6470e0d..e5c7ac2 100644 (file)
@@ -2228,13 +2228,18 @@ final class t3lib_BEfunc {
                                        }
                                        break;
                                case 'input':
-                                       if (isset($value)) {
+                                               // currently, this feature does not show "0" or the date
+                                               // "1970-01-01", but this is a DB limitation, as we cannot
+                                               // differentiate between "0" and "NULL" in the DB
+                                               // however, this solution is the most "user-friendly" for
+                                               // 99.9% percent of all use-cases.
+                                       if (!empty($value)) {
                                                if (t3lib_div::inList($theColConf['eval'], 'date')) {
                                                        $l = self::date($value) .
-                                                                       ' (' .
-                                                                       ($GLOBALS['EXEC_TIME'] - $value > 0 ? '-' : '') .
-                                                                       self::calcAge(abs($GLOBALS['EXEC_TIME'] - $value), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')) .
-                                                                       ')';
+                                                               ' (' .
+                                                               ($GLOBALS['EXEC_TIME'] - $value > 0 ? '-' : '') .
+                                                               self::calcAge(abs($GLOBALS['EXEC_TIME'] - $value), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')) .
+                                                               ')';
                                                } elseif (t3lib_div::inList($theColConf['eval'], 'time')) {
                                                        $l = self::time($value, FALSE);
                                                } elseif (t3lib_div::inList($theColConf['eval'], 'timesec')) {