Page 1 of 1

2k11 staticpage date bug (win)

Posted: Mon Mar 25, 2013 6:30 pm
by Timbalu
In plugin_staticpage.tpl on line 40, this

Code: Select all

{$staticpage_lastchange|date_format:$template_option.date_format}
needs to be changed to

Code: Select all

{$staticpage_lastchange|@formatTime:$template_option.date_format}
else you get a

Code: Select all

M�rz
A |date_format modifier is best used with :"%Y-%m-%d" only.

Re: 2k11 staticpage date bug (win)

Posted: Mon Mar 25, 2013 10:32 pm
by Don Chambers
... and probably does not need with "@" for smarty 3.

Re: 2k11 staticpage date bug (win)

Posted: Tue Mar 26, 2013 11:31 am
by Timbalu
Well, YL used that all over, since the @ tells Smarty (2!) to pass the entire array to the modifier rather than calling the modifier for each element of the array (which leaves you to think about, if this assigned var (at the moment it is passed) is actually an array...). But as 2k11 is used with older S9y < Smarty3 environments too, I left the @ notation here.

The point I wanted to note, using the |formatTime modifier here is much better, since already switching "%e" with "%d" for WIN users, before passing the same to strftime(), which avoids this (..locale) "Bug".

Re: 2k11 staticpage date bug (win)

Posted: Tue Mar 26, 2013 7:07 pm
by Don Chambers
That's good to know.

Re: 2k11 staticpage date bug (win)

Posted: Tue Mar 26, 2013 7:38 pm
by yellowled
You know, it would be much easier to just send a pull request on the 2k11 repo on GitHub, but never mind. Thanks for noticing.

YL