Bug #21838
closedDate field on TCA can't accept 1-1-1970 as
0%
Description
The problem arises when a backend field is setted as an input with an date evaluation ni the TCA (like this :
'dateacquisition' => array (
'exclude' => 0,
'label' => 'LLL:EXT:tactic_repoeuvres/locallang_db.xml:tx_tacticrepoeuvres_Oeuvres.dateacquisition',
'config' => array (
'type' => 'input',
'size' => '8',
'max' => '20',
'eval' => 'date',
'checkbox' => '0',
'default' => '0'
)
),
)
When you enter 1-1-1970 as a date, the javascript evaluation erases the field.
Tried on Firefox 3.5 and IE 8.
To fix the problem, I added the following line :
if (this.lastDate==0) {this.lastDate++;} // Adds one second if 1-1-1970 is entered, so the variable won't be evaluated as null
in the file :
t3lib\jsfunc.evalfield.js
after line 831
So that the zone becomes :
this.lastDate+=add*24*60*60;
if (this.lastDate==0) {this.lastDate++;} // Adds one second if 1-1-1970 is entered, so the variable won't be evaluated as null
return this.lastDate;
That makes sure a 1-1-1970 date would get a minimum of 1 second as a timestamp and won't be evaluated to null.
I am open to any other way to correct this bug.
(issue imported from #M13005)
Updated by Alexander Opitz over 11 years ago
- Status changed from New to Needs Feedback
- Target version deleted (
0)
The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?
Updated by Équipe Tactic over 11 years ago
The issue still exists in 4.5. Can't use negative or null dates.
Updated by Alexander Opitz over 11 years ago
- Status changed from Needs Feedback to New
Updated by Mathias Schreiber over 9 years ago
- Status changed from New to Closed
- Is Regression set to No
Closing as dupe of #37244 which is WIP