[Typo3] BE Date Input Format (US Date)

Jeff Segars jsegars at alumni.rice.edu
Thu Sep 1 18:30:49 CEST 2005


Hey John,
I've made the same mod and its worked well for me too.

Just wanted to let you kno that we should have a non-patched solution 
for US dates when the next TYPO3 release rolls around.  Kasper has added 
a variable for US date format to TYPO3_CONF_VARS that makes the 
switching automatic.  It hasn't made it into CVS yet, but I'm hoping to 
see it in the next release.

Jeff

John Romano wrote:
> 
> 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