* Fixed bug #4515: Input field with settings eval date and readOnly shows...
authorMichael Stucki <michael.stucki@typo3.org>
Fri, 17 Nov 2006 19:07:20 +0000 (19:07 +0000)
committerMichael Stucki <michael.stucki@typo3.org>
Fri, 17 Nov 2006 19:07:20 +0000 (19:07 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1802 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tceforms.php

index b0f2c89..eabacd2 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
        * Fixed bug #4059: options.hideRecords.pages doesn't work for mounted pages
        * Fixed bug #4379: pageNotFound_handling ignores forceCharset setting
        * Fixed bug #3115: JavaScript error on clickmenu in filelist module
+       * Fixed bug #4515: Input field with settings eval "date" and readOnly shows 01-01-1970 if the value is empty
 
 2006-11-17  Martin Kutschker  <martin.t.kutschker@blackbox.net>
 
index ea48c0d..c70c9a8 100755 (executable)
@@ -2467,15 +2467,19 @@ class t3lib_TCEforms    {
                $format = trim($config['format']);
                switch($format) {
                        case 'date':
-                               $option = trim($config['format.']['option']);
-                               if ($option)    {
-                                       if ($config['format.']['strftime'])     {
-                                               $value = strftime($option,$itemValue);
+                               if ($itemValue) {
+                                       $option = trim($config['format.']['option']);
+                                       if ($option)    {
+                                               if ($config['format.']['strftime'])     {
+                                                       $value = strftime($option,$itemValue);
+                                               } else {
+                                                       $value = date($option,$itemValue);
+                                               }
                                        } else {
-                                               $value = date($option,$itemValue);
+                                               $value = date('d-m-Y',$itemValue);
                                        }
                                } else {
-                                       $value = date('d-m-Y',$itemValue);
+                                       $value = '';
                                }
                                if ($config['format.']['appendAge'])    {
                                        $value .= ' ('.t3lib_BEfunc::calcAge((time()-$itemValue), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')).')';