Re: [SMARTY] date_format question

From: Date: Tue, 04 Jan 2005 15:42:25 +0000
Subject: Re: [SMARTY] date_format question
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-12109@lists.php.net to get a copy of this message
On Tue, Jan 04, 2005 at 10:04:07AM -0500, Travis Low wrote: > Hello again. I had suggested the possibility of adding an offset to the > date_format modifier. Messju suggested using setlocale(), which I agree > with in principle, but I'm having trouble finding the definitive way to > use setlocale() so that it works on the widest possible range of servers. > (See http://us2.php.net/setlocale) > > Could I get a yes or no on whether the offset could be added to the > date_format modifier? Seems to me it wouldn't hurt you if you chose to > use setlocale(), but it would help you a lot if you didn't. > > If it's "no", could I please get some help generating a good drop-down > list for input to setlocale()? hmm, "no" from me. i'm not the overall authority on this, but nobody else seems to care right now. i'd do the following: make plugins_dir an array('myplugins/', SMARTY_DIR . 'plugins'); put your modified modifier.date_format in 'myplugins/' - your date_format will override smarty's, since it is found earlier in the plugins_dir-path - no problems when you upgrade smarty or switch version in other ways that's what i do, when i have modifications on the distributions' plugins that don't fit into the distribution. as for setlocale: since php-4.3.0 setlocale can take an array of locales and tries all them until one can be set successfully. so get hold of the correct locale-names of all the supported operating-systems of your application and pass all of them to setlocale(). that's the easiest solution, IMHO. HTH messju > Thanks! > > cheers, > > Travis > > -- > Travis Low > <mailto:travis@dawnstar.com> > <http://www.dawnstar.com> > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.smarty.general (#12109) next »