diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2012-11-14 05:36:04 -0800 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2012-11-14 05:36:04 -0800 |
commit | 49f05dfadefc5ec38ff413adeeccae7fe5317dd8 (patch) | |
tree | 81c24dad5428420f034282c142d42ed905d29d2f /core | |
parent | e06513d76bb7b91f6969ce318f66c8b1c0cc264a (diff) | |
parent | 7d01342babcd3ce699d05bcceac2690ced110562 (diff) | |
download | nextcloud-server-49f05dfadefc5ec38ff413adeeccae7fe5317dd8.tar.gz nextcloud-server-49f05dfadefc5ec38ff413adeeccae7fe5317dd8.zip |
Merge pull request #402 from zimba12/master
Uncomment hours entries in relative date functions
Diffstat (limited to 'core')
-rw-r--r-- | core/js/js.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/core/js/js.js b/core/js/js.js index 2b2a64d25f9..164fab80ed4 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -641,7 +641,7 @@ if (!Array.prototype.map){ /** * Filter Jquery selector by attribute value - **/ + */ $.fn.filterAttr = function(attr_name, attr_value) { return this.filter(function() { return $(this).attr(attr_name) === attr_value; }); }; @@ -675,7 +675,8 @@ function formatDate(date){ return $.datepicker.formatDate(datepickerFormatDate, date)+' '+date.getHours()+':'+((date.getMinutes()<10)?'0':'')+date.getMinutes(); } -/* takes an absolute timestamp and return a string with a human-friendly relative date +/** + * takes an absolute timestamp and return a string with a human-friendly relative date * @param int a Unix timestamp */ function relative_modified_date(timestamp) { @@ -687,14 +688,14 @@ function relative_modified_date(timestamp) { if(timediff < 60) { return t('core','seconds ago'); } else if(timediff < 120) { return t('core','1 minute ago'); } else if(timediff < 3600) { return t('core','{minutes} minutes ago',{minutes: diffminutes}); } - //else if($timediff < 7200) { return '1 hour ago'; } - //else if($timediff < 86400) { return $diffhours.' hours ago'; } + else if(timediff < 7200) { return t('core','1 hour ago'); } + else if(timediff < 86400) { return t('core','{hours} hours ago',{hours: diffhours}); } else if(timediff < 86400) { return t('core','today'); } else if(timediff < 172800) { return t('core','yesterday'); } else if(timediff < 2678400) { return t('core','{days} days ago',{days: diffdays}); } else if(timediff < 5184000) { return t('core','last month'); } - //else if($timediff < 31556926) { return $diffmonths.' months ago'; } - else if(timediff < 31556926) { return t('core','months ago'); } + else if(timediff < 31556926) { return t('core','{months} months ago',{months: diffmonths}); } + //else if(timediff < 31556926) { return t('core','months ago'); } else if(timediff < 63113852) { return t('core','last year'); } else { return t('core','years ago'); } } |