aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscambra <sergio@entrecables.com>2012-09-21 07:38:07 +0200
committerscambra <sergio@entrecables.com>2012-10-16 20:25:11 +0200
commit5ecce8bfb7e615b4b0576ff28d21e5b8a5d68878 (patch)
treecc531cc89efac0eab8819ae81cd508297970d1b7
parentec253f1354b6993cf204ee60ec87350119a3c91e (diff)
downloadnextcloud-server-5ecce8bfb7e615b4b0576ff28d21e5b8a5d68878.tar.gz
nextcloud-server-5ecce8bfb7e615b4b0576ff28d21e5b8a5d68878.zip
Translate modification date when file is created/uploaded, use same strings as lib/template.php
-rw-r--r--apps/files/js/files.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 777a5ec647e..fe89b8105ac 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -843,20 +843,19 @@ function relative_modified_date(timestamp) {
var diffhours = Math.round(diffminutes/60);
var diffdays = Math.round(diffhours/24);
var diffmonths = Math.round(diffdays/31);
- var diffyears = Math.round(diffdays/365);
if(timediff < 60) { return t('files','seconds ago'); }
- else if(timediff < 120) { return '1 '+t('files','minute ago'); }
- else if(timediff < 3600) { return diffminutes+' '+t('files','minutes ago'); }
+ else if(timediff < 120) { return t('files','1 minute ago'); }
+ else if(timediff < 3600) { return t('files','{minutes} minutes ago',{minutes: diffminutes}); }
//else if($timediff < 7200) { return '1 hour ago'; }
//else if($timediff < 86400) { return $diffhours.' hours ago'; }
else if(timediff < 86400) { return t('files','today'); }
else if(timediff < 172800) { return t('files','yesterday'); }
- else if(timediff < 2678400) { return diffdays+' '+t('files','days ago'); }
+ else if(timediff < 2678400) { return t('files','{days} days ago',{days: diffdays}); }
else if(timediff < 5184000) { return t('files','last month'); }
//else if($timediff < 31556926) { return $diffmonths.' months ago'; }
else if(timediff < 31556926) { return t('files','months ago'); }
else if(timediff < 63113852) { return t('files','last year'); }
- else { return diffyears+' '+t('files','years ago'); }
+ else { return t('files','years ago'); }
}
function getMimeIcon(mime, ready){