Date Format
bugs:341[link1]The problem
The default formatting for dates and times in WackoWiki[link3] is pretty much hard coded thru out the PHP code. The day.month.year and year-month-day formats aren't natural for us westerners to read.The solution
Adding some config options which allow the user to set the string passed into the date() function.A patch
I've done an implementation from R4.2. You can download the patch here[link4]. The patch doesn't add defaults to 'wakka.config.php' file, so unless you're gonna re-run wacko setup you will need to add these manually. See the code block below.Details
What i've done is add a few new items into the config. You'll have to add these yourself if your applying the patch or all hell will break loose."date_format" => "m/d/Y", "time_format" => "h:i a", "time_format_seconds" => "h:i:s a", "name_date_macro" => "%s (%s)", "date_macro_format" => "m/d/Y h:i a",
The format strings are passed into the PHP date() function[link5]. Use the the date() reference[link5] to understand what each character means.
The 'name_date_macro' isn't directly related to date formats, but it was a simple change. The first %s is the user name and the second %s is where the date goes. This little change allows you to change the formatting of this macro.
Future Implementation
My implementation works well, but could probably use some improvements. It's arguable if these things really belong in $wackoLanguage and not $config as it's sort of a localization issue. You could also argue that it's a matter of personal preference and belongs as part of the user settings.Also the change i made for 'name_date_macro' should be expanded into a more powerful configuration language for wacko macros. Possibly in a way similar to how {{actions}} work.
Discussion
WackoWiki 6.1 implemented the IntlDateFormatter[link6].
- [link1] https://wackowiki.org/bugs/view.php?id=341
- [link2] https://wackowiki.org/bugs/view.php?id=56
- [link3] https://wackowiki.org/doc/WackoWiki
- [link4] http://www.sickheadgames.com/stuff/datetime.patch
- [link5] http://us2.php.net/manual/en/function.date.php
- [link6] https://wackowiki.org/doc/Dev/Release/R6.1/IntlDateFormatter