summaryrefslogtreecommitdiffstats
path: root/extensions/BugModal/web/bug_modal.js
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-05-27 05:57:29 +0200
committerByron Jones <glob@mozilla.com>2015-05-27 05:57:29 +0200
commit35aab8c392ac6ad404bb0d902cca6b50480072da (patch)
tree035f26e0c3151fbd088b07c6e8140ce6412c5f2e /extensions/BugModal/web/bug_modal.js
parent087f74073fdc81ec5707f2989c99b34770e864eb (diff)
downloadbugzilla-35aab8c392ac6ad404bb0d902cca6b50480072da.tar.gz
bugzilla-35aab8c392ac6ad404bb0d902cca6b50480072da.tar.xz
Bug 1158010: provide a standard and simple way to render relative dates, in perl and javascript
Diffstat (limited to 'extensions/BugModal/web/bug_modal.js')
-rw-r--r--extensions/BugModal/web/bug_modal.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/extensions/BugModal/web/bug_modal.js b/extensions/BugModal/web/bug_modal.js
index 66e214ad6..32949828f 100644
--- a/extensions/BugModal/web/bug_modal.js
+++ b/extensions/BugModal/web/bug_modal.js
@@ -8,6 +8,17 @@
$(function() {
'use strict';
+ // update relative dates
+ window.setInterval(function() {
+ var now = Math.floor(new Date().getTime() / 1000);
+ $('.rel-time').each(function() {
+ $(this).text(timeAgo(now - $(this).data('time')));
+ });
+ $('.rel-time-title').each(function() {
+ $(this).attr('title', timeAgo(now - $(this).data('time')));
+ });
+ }, 60000);
+
// all keywords for autocompletion (lazy-loaded on edit)
var keywords = [];