]> git.wh0rd.org - tt-rss.git/commitdiff
limit smart_date_time stuff to headlines only
authorAndrew Dolgov <noreply@fakecake.org>
Fri, 3 Jul 2015 20:36:47 +0000 (23:36 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Fri, 3 Jul 2015 20:36:47 +0000 (23:36 +0300)
classes/feeds.php
include/functions.php

index 9dccdbc83766dd8da2d3543c789ea53ce0ee0943..bedfe649992001f5ccff3d5696622bb82c79b311 100644 (file)
@@ -376,7 +376,7 @@ class Feeds extends Handler_Protected {
 #                              $content_link = "<a href=\"javascript:viewContentUrl('".$line["link"]."');\">" .
 #                                      $line["title"] . "</a>";
 
-                               $updated_fmt = make_local_datetime($line["updated"], false);
+                               $updated_fmt = make_local_datetime($line["updated"], false, false, false, true);
                                $date_entered_fmt = T_sprintf("Imported at %s",
                                        make_local_datetime($line["date_entered"], false));
 
index 84c1e35ff5f3ee3b271051321a51e5da0ef43a27..22179e1a4c74f59598fba6b753bef8573cc2ad7d 100644 (file)
        }
 
        function make_local_datetime($timestamp, $long, $owner_uid = false,
-                                       $no_smart_dt = false) {
+                                       $no_smart_dt = false, $eta_min = false) {
 
                if (!$owner_uid) $owner_uid = $_SESSION['uid'];
                if (!$timestamp) $timestamp = '1970-01-01 0:00';
 
                if (!$no_smart_dt) {
                        return smart_date_time($user_timestamp,
-                               $tz_offset, $owner_uid);
+                               $tz_offset, $owner_uid, $eta_min);
                } else {
                        if ($long)
                                $format = get_pref('LONG_DATE_FORMAT', $owner_uid);
                }
        }
 
-       function smart_date_time($timestamp, $tz_offset = 0, $owner_uid = false) {
+       function smart_date_time($timestamp, $tz_offset = 0, $owner_uid = false, $eta_min = false) {
                if (!$owner_uid) $owner_uid = $_SESSION['uid'];
 
-               if (date("Y.m.d.G", $timestamp) == date("Y.m.d.G", time() + $tz_offset)) {
+               if ($eta_min && date("Y.m.d.G", $timestamp) == date("Y.m.d.G", time() + $tz_offset)) {
                        return T_sprintf("%d min", date("i", time() + $tz_offset - $timestamp));
                } else if (date("Y.m.d", $timestamp) == date("Y.m.d", time() + $tz_offset)) {
                        return date("G:i", $timestamp);