xoops forums

ianez

Not too shy to talk
Posted on: 2011/4/7 15:34
ianez
ianez (Show more)
Not too shy to talk
Posts: 188
Since: 2006/1/26
#1

javascript calendar date format localization

don't know if this is the right place for posting..
This is a sort of bug report and a solution proposal at the same time.

Actually the jscript calendar shows a date in the american format: y-mm-dd
I was not able to find where to change language files for having other format like for example: dd-mm-y
Now I've find a fix that works for me and may be could be inserted in the next to come 2.5.1 release.

A)in include/calendarjs.php changed lines 86/87 from:
Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd";
Calendar._TT["TT_DATE_FORMAT"] = "y-mm-dd";


to
Calendar._TT["DEF_DATE_FORMAT"] = "<?php echo _CAL_DEF_DATE_FORMAT;?>";
Calendar._TT["TT_DATE_FORMAT"] = "<?php echo _CAL_TT_DATE_FORMAT;?>";


B) in language/[my_language_name]/calendar.php
added in the end two lines
define("_CAL_DEF_DATE_FORMAT""dd-mm-y");
define("_CAL_TT_DATE_FORMAT""dd-mm-y");


this will give a clean localization option to all translators also for jscript calendar, provided that no other solution has been developed

let me know your opinion
Ian

Mamba

Moderator
Posted on: 2011/4/18 17:56
Mamba
Mamba (Show more)
Moderator
Posts: 10988
Since: 2004/4/23
#2

Re: javascript calendar date format localization

Hmm, unless it is overwritten somewhere else to a local date format, then you're right - it shouldn't be "hard-coded" there.

Can you enter it on SourceForge as a bug, with a link to this message, so we can keep track of this suggestion?
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

ianez

Not too shy to talk
Posted on: 2011/4/18 18:12
ianez
ianez (Show more)
Not too shy to talk
Posts: 188
Since: 2006/1/26
#3

Re: javascript calendar date format localization

done
https://sourceforge.net/tracker/?func= ... roup_id=41586&atid=430840

ForMusS

Core Developer
Posted on: 2011/9/13 20:56
ForMusS
ForMusS (Show more)
Core Developer
Posts: 146
Since: 2007/10/19
#4

Re: javascript calendar date format localization

Hello,

Fixed in SVN and waiting for review
Thanks for your report

Nicolas