[Typo3] BE Date Input Format (US Date)
John Romano
typo3 at pb.net
Thu Sep 1 18:17:57 CEST 2005
This mod, so far, appears to be working for me; your mileage may vary.
I did not find any specific How-To to change the BE date input from
d-m-y to m-d-y.
Here's the diff between my modded file and the original.
/typo3_src-3.8.0/t3lib/jsfunc.evalfield.js
Lines 347 and 350 swap the day and month array index.
Line 347
Original:
var month =
(values.values[2])?this.parseInt(values.values[2]):today.getMonth()+1;
New:
var month =
(values.values[1])?this.parseInt(values.values[1]):today.getMonth()+1;
Line 350
Original:
var day =
(values.values[2])?this.parseInt(values.values[2]):today.getDate();
New:
var day =
(values.values[1])?this.parseInt(values.values[1]):today.getDate();
Line 353 does a check to make sure date entered is not epoc/zero.
Line 353:
Original:
if (''+day+'-'+month+'-'+year == "1-1-1970") {
New
if (''+month+'-'+day+'-'+year == "1-1-1970") {
Line 418 formats the output of the date.
Line 418:
Original
theString =
theTime.getDate()+'-'+(theTime.getMonth()+1)+'-'+this.getYear(theTime);
New
theString =
(theTime.getMonth()+1)+'-'+theTime.getDate()+'-'+this.getYear(theTime);
-John Romano
More information about the TYPO3-english
mailing list