[TYPO3-dev] bug dbType for date before 01-01-1970
BIDAU
ismael.bidau at ensci.com
Fri Sep 26 14:31:03 CEST 2014
I check the actual value sent by form submission.
Here the second part of the patch :
In jsfunc.evalfield.js
for displaying data from mysql
function evalFunc_output
replace (L438)
var theTime = new Date(parseInt(value) * 1000);
with
var valueUTC= this.convertClientTimestampToUTC(value, 0);
var theTime = new Date(parseInt(valueUTC) * 1000);
to convert date to timestamp, function evalFunc_input
replace (L373)
var theTime = new Date(parseInt(year), parseInt(month)-1, parseInt(day));
// Substract timezone offset from client
this.lastDate = this.convertClientTimestampToUTC(this.getTimestamp(theTime), 0);
with
this.lastDate = Date.UTC(parseInt(year), parseInt(month)-1, parseInt(day)) / 1000;
I think the problem is when using "new Date", timezone has effect. We have to use Date.UTC instead.
It works for me
Can somebody test this ?
Ismaël BIDAU
More information about the TYPO3-dev
mailing list