[Typo3-dev] Modify Date Format in TCA
Jeff Segars
jsegars at alumni.rice.edu
Thu Jul 14 18:25:06 CEST 2005
I've answered this one a couple times in the past, but I can't seem to
turn up the threads in a search so I guess I can't fault you for not
finding it either :)
The date format is driven by javascript at t3lib/jsfunc.evalfield.js.
The first place a change needs to be made is within the evalFunc_input
function, around lines 348 and 351. The array index for values.value[]
can be swapped around between these two lines so that it expects the
month first and the date second.
The second changes is in evalFunc_output around line 356. The getMonth
and getDate calls need to be swapped here as well.
I've got a small extension that makes this change, but its a nasty
XCLASS extension. If you want a copy, give me your username and I'll
add you to the member list. Also, I believe Kasper is planning to add a
variable into the next release where this can be specified without a
core patch or extension.
Hope that helps...
jeff
Keith Morrison wrote:
> Hi all,
>
> OK, I've RTFM, scoured google, etc, and I can't find an answer to this
> question: how do I change the format of a date field in the backend?
> Since I'm in the U.S., my users won't stop complaining about the date
> being dd-mm-yy, and I want to change it so that it reads mm-dd-yy. So,
> if they click on the checkbox, it will pop up the current date+1 in the
> field in that format; also, the solution would ideally stop screwing up
> the Date2Calendar extension--somewhere, some code is restricting the mm
> part of dd-mm-yy to go no higher than 12, which is probably some
> error-checking javascript to keep months in the correct range. I'd
> appreciate anyone just pointing out the right file(s) to me at this point.
>
> Thanks,
> Keith
>
> PS If you are feeling especially generous, you might give me some advice
> on how to deal with users who are also complaining about the 24-hour
> clock, instead of using AM/PM--anyone have any experience here?
More information about the TYPO3-dev
mailing list