Is there any way to display time since latest comment instead of the standard format?
I'm using 2.3 and already tried TimeAgo plugin, doesn't seem to work (or I'm not doing it right which is a good possibility).
Instead of displaying something like "December 14", I'd like to have "2 hours ago" and "1 minute ago" kind of format on each discussion based on latest comment.
How can one accomplish that?
Best Answer
-
River MVP
Yes.
apply this change
$sender->addJsFile('timeago.min.js', 'plugins/timeago'); // PROPER CORRECT STYLE
https://github.com/kasperisager/vanilla-timeago/blob/master/class.timeago.plugin.php#L61
if css and js do not load in a plugin it is because it uses the old style which DOES NOT WORK
// Add required assets $sender->addJsFile($this->getResource('js/timeago.min.js', false, false)); // OLD BAD
https://github.com/kasperisager/vanilla-timeago/archive/master.zip
make sure you name the folder appropriately if you download from github. if you can't disable the plugin from dashboard the folder is named incorrectly.
Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.
5
Answers
Yes.
apply this change
$sender->addJsFile('timeago.min.js', 'plugins/timeago'); // PROPER CORRECT STYLE
https://github.com/kasperisager/vanilla-timeago/blob/master/class.timeago.plugin.php#L61
if css and js do not load in a plugin it is because it uses the old style which DOES NOT WORK
https://github.com/kasperisager/vanilla-timeago/archive/master.zip
make sure you name the folder appropriately if you download from github. if you can't disable the plugin from dashboard the folder is named incorrectly.
Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.
@River thanks a lot, that worked like a charm!
@linc can you attach this one to the proper addon as well https://vanillaforums.org/discussion/32934/is-there-any-way-to-display-time-since-latest-comment-instead-of-the-standard-format
https://vanillaforums.org/addon/timeago-plugin
and also maybe kasperisager can update the add-on in the add-ons section to reflect the latest fixes and versioning, if he comes back, if he has the time.
Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.