Discussion about the date and time-format (not) used in wikka


Date formatting

Hi folks,

trying to figure out how to change the date format displayed in Page History and Revisions to something more functional than the "Romance Daylight Time" I get in my wikka installation. Could someone point me in the right direction please? Thanks for a really good wiki btw!

--EgilHelland

In handlers/page/revisions.php replace
$output .= "<td>&nbsp;<a href=\"".$this->Href("show","","time=").urlencode($page["time"])."\">".$page["time"]."</a></td>";

with something like
$output .= "<td>&nbsp;<a href=\"".$this->Href("show","","time=").urlencode($page["time"])."\">".date("l dS of F Y h:i:s A",strtotime($page["time"]))."</a></td>";

in handlers/page/history.php replace
$output .= "<strong>Edited on <a href=\"".$this->Href("", "", "time=".urlencode($pageA["time"]))."\">".$pageA["time"]."</a> by ".$EditedByUser."</strong> <span style=\"color:#888;font-size:smaller;\">".$note."</span><br />\n";

with something like
$output .= "<strong>Edited on <a href=\"".$this->Href("", "", "time=".urlencode($pageA["time"]))."\">".date("l dS of F Y h:i:s A",strtotime($pageA["time"]))."</a> by ".$EditedByUser."</strong> <span style=\"color:#888;font-size:smaller;\">".$note."</span><br />\n";

See php documentation for details on the date() function.
I think it would be nice to add a function for this to the wikka-class and call it everywhere, where times are printed out - would make such things a bit easier (especially if there would be a $DefaultTimeFormat in the config-array).
--TimoK

Standard date and time format
Although I'm all for using the ISO date/time format as we see in the timestamp of the footer of every page, I note that several other parts of Wikka use different date/time formats. I'd like to see an approach where this is standardized.
Proposal:
I realize that in principle it's possible to pick up formats from a locale but for a Wikka targeted at an international audience this may not be the best approach, and for a Wikka with a "local" audience it may not be either if it's hosted on a (public) server outside that country - hence the idea to define a format in the configuration.
--JavaWoman


CategoryDevelopmentFormatters
There are 6 comments on this page. [Show comments]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki