This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Comment Time
#1

Hi Steven,

A comment that was made last night at 11:27pm STILL shows "Today 11:27pm" AND it's 6:39pm the next day!

WHY wouldn't it display "Yesterday" ?????

How can this be corrected?

Thanks.
Reply
#2

In /frontend/model/main/comments.php, try replacing the public function calculateDayDifference($date_added) method with this:

PHP Code:
<?php 
public function calculateDayDifference($date_added)
{
    $today = date('Y-m-d');

    $yesterday = date('Y-m-d', strtotime('-1 day'));

    $date_added = date('Y-m-d', strtotime($date_added));

    if ($date_added == $today) {
        return 0;
    } else if ($date_added == $yesterday) {
        return 1;
    } else {
        return 2;
    }
}

Don't forget to clear the cache afterwards in Tools -> Clear Cache (if enabled).

Have you completed the interview?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by afoster
02-Aug-2020, 10:40 PM
Last Post by Steven
10-Jan-2018, 09:58 PM
Last Post by noblues
08-Mar-2015, 05:08 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)