summaryrefslogtreecommitdiff
path: root/include/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2015-07-18 00:01:37 +0300
committerAndrew Dolgov <[email protected]>2015-07-18 00:01:37 +0300
commit97aa917c6d7f16fbf57edd69cdbbe55263d3f99b (patch)
tree93f969b9adf06ced5b979a5b1b8a4215f68caf0e /include/functions.php
parent1b5553c572329df602f02bc2f2b55159a5c63f4c (diff)
smart_date_time: better eta_min handling
Diffstat (limited to 'include/functions.php')
-rw-r--r--include/functions.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/functions.php b/include/functions.php
index e5f2ca486..c27455220 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -960,7 +960,7 @@
function smart_date_time($timestamp, $tz_offset = 0, $owner_uid = false, $eta_min = false) {
if (!$owner_uid) $owner_uid = $_SESSION['uid'];
- if ($eta_min && date("Y.m.d.G", $timestamp) == date("Y.m.d.G", time() + $tz_offset)) {
+ if ($eta_min && time() + $tz_offset - $timestamp < 3600) {
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);