Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Show date instead of "Hours ago" etc
jross
New
I would really like to post the date and time next to a post instead of showing 12 hours ago - or 5 seconds ago or minutes ago.
Any easy solution for this?
0
This discussion has been closed.
Comments
1) Theme change:
Open up themes\comments.php and locate line 94: <span>'.$this->Context->GetDefinition('CommentTime').'</span>'.TimeDiff($this->Context, $Comment->DateCreated); Change it to: <span>'.$this->Context->GetDefinition('CommentTime').'</span>'.date(XYZ, $Comment->DateCreated);
where XYZ is the format you want to view the time/date in, based on php.net's date function guidelines. Once you have made this change, save the new file to themes\vanilla
OR
2) Change the TimeDiff function in Framework.Functions.php. This could be done as an extension (I believe) using the object factory. Working out how to do it would take me some time (though it shouldnt be particularly complex) and as I dont know if it could have any adverse affects I wont go into it here now. If someone wants me to I'll take a look though.
return date('H:i:s Y-m-d', $Time);
(or however you want the date to look)here's something i quickly made up but i'm going fix it up a bit so i claim rights to finishing this extension :P
<?php /* Extension Name: Date Settings Extension Url: http://lussumo.com/addons/ Description: Configurable Date Settings Version: 1.0 Author: Chris Vincent Author Url: http://ourpaintbox.com */ if($Context->SelfUrl == "index.php") { function TimeChooser(&$DiscussionGrid) { $TimeFormat = 'H:i:s Y-m-d'; $DiscussionClass = $DiscussionGrid->DelegateParameters['Discussion']; $DiscussionGrid->DelegateParameters['DiscussionList'] = str_replace( TimeDiff($DiscussionGrid->Context, $DiscussionClass->DateLastActive,mktime()), date($TimeFormat, $DiscussionClass->DateLastActive), $DiscussionGrid->DelegateParameters['DiscussionList']); } $Context->AddToDelegate("DiscussionGrid", "PostDiscussionOptionsRender", "TimeChooser"); } ?>
Surely if it says "minutes ago" or "hours ago" the date is obviously today and "one day ago" is obviously yesterday?
It's a nice touch, relative dates is a cool thing to have and works well as long as you know what day it is.
I guess I'm just used to it, the Mac Finder has had this as an option for years.
Posted: Friday, 12 January 2007 at 11:21AM (AEDT)