Forums / Cotonti / Support / name of the day with callback

Twiebie
#1 2011-10-25 01:24

I'm using the {FORUMS_POSTS_ROW_CREATION_STAMP|cot_date('l, F d, Y H:i', $this)} callback and it works fine with every day of the month except for Thursday...

It shows Thursday as: "rsday".

First I thought this was an issue with my localhost, but now I put it on a live server it's still producing the same issue.

Bit weird, isn't it?

GHengeveld
#2 2011-10-25 14:49

Okay I found the bug. Quickfix is to replace $L['Thursdayv'] with $L['Thursday_s'] in main.en.lang.php. Thats the direct cause of the issue. However I found that the way in which datetimes are localized isn't quite perfect, because it replaces days twice. First it replaces the full day representation, so PHP-generated Thursday is replaced by the localized version of Thursday, then it replaces the shorthand version too, so localized Thursday is replaced in part with localized Thu. Since 'Thu' was bugged, it got replaced by an empty string.

So in short, you can fix it by fixing the language file, but I need to fix the cot_date function as well so it won't replace things twice like that and also it shouldn't replace PHP English with localized English (since they are obviously identical).

Added 21 minutes later:

Fixed in 7cb86132b99f695304f5d43db7c4b55382046bb2

This post was edited by GHengeveld (2011-10-25 15:10, 12 years ago)
Twiebie
#3 2011-10-25 15:33

Thanks, Gert!