summaryrefslogtreecommitdiffstats
path: root/lib/template.php
diff options
context:
space:
mode:
authorJakob Sack <kde@jakobsack.de>2011-08-06 11:38:49 +0200
committerJakob Sack <kde@jakobsack.de>2011-08-06 11:38:49 +0200
commit501b767e6ee10ac2e3b43f42c1c4c991b13fca0e (patch)
tree1b62f81a9b09d4ea7703b7c0bbd31ed2ba4a505c /lib/template.php
parent5f7c040ec031c151f0f3bc628506ce78b127ad2f (diff)
parentf039320a0b432937297c3deb93c1c78fe2d8d4a9 (diff)
downloadnextcloud-server-501b767e6ee10ac2e3b43f42c1c4c991b13fca0e.tar.gz
nextcloud-server-501b767e6ee10ac2e3b43f42c1c4c991b13fca0e.zip
Merge branch 'master' of git://anongit.kde.org/owncloud
Diffstat (limited to 'lib/template.php')
-rw-r--r--lib/template.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/template.php b/lib/template.php
index 045ecdaf130..b8adba0833f 100644
--- a/lib/template.php
+++ b/lib/template.php
@@ -82,19 +82,19 @@ function relative_modified_date($timestamp) {
$diffdays = round($diffhours/24);
$diffmonths = round($diffdays/31);
$diffyears = round($diffdays/365);
+
if($timediff < 60) { return 'seconds ago'; }
else if($timediff < 120) { return '1 minute ago'; }
else if($timediff < 3600) { return $diffminutes.' minutes ago'; }
//else if($timediff < 7200) { return '1 hour ago'; }
//else if($timediff < 86400) { return $diffhours.' hours ago'; }
- else if($timediff < 86400) { return 'today'; }
- else if($timediff < 172800) { return 'yesterday'; }
+ else if((date('G')-$diffhours) > 0) { return 'today'; }
+ else if((date('G')-$diffhours) > -24) { return 'yesterday'; }
else if($timediff < 2678400) { return $diffdays.' days ago'; }
else if($timediff < 5184000) { return 'last month'; }
- //else if($timediff < 31556926) { return $diffmonths.' months ago'; }
- else if($timediff < 31556926) { return 'months ago'; }
+ else if((date('n')-$diffmonths) > 0) { return 'months ago'; }
else if($timediff < 63113852) { return 'last year'; }
- else { return $diffyears.' years ago'; }
+ else { return 'years ago'; }
}