Changing date format in multilanguage?!?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
jmansa
Forum Members
Forum Members
Posts: 126
Joined: Thu Oct 19, 2006 2:46 pm

Changing date format in multilanguage?!?

Post by jmansa »

Is it possible to change date format in news when changing language in multilanguage, and if yes... How?
alby

Re: Changing date format in multilanguage?!?

Post by alby »

jmansa wrote: Is it possible to change date format in news when changing language in multilanguage, and if yes... How?
Add a new UDT mle_dateformat:

Code: Select all

global $hl;
if($hl == 'it') echo '%d %m %Y'; 
elseif($hl == 'en') echo '%m %d %Y'; 
In page template (or option metadata field if you have a single page with news):

Code: Select all

{capture name=hldateformat}{mle_dateformat}{/capture}
and in news tag:

Code: Select all

{news dateformat=$smarty.capture.hldateformat}
Alby
jmansa
Forum Members
Forum Members
Posts: 126
Joined: Thu Oct 19, 2006 2:46 pm

Re: Changing date format in multilanguage?!?

Post by jmansa »

Thanks alot... That did the trick... ;D
Post Reply

Return to “CMSMS Core”