diff options
author | Byron Jones <glob@mozilla.com> | 2015-05-27 05:57:29 +0200 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2015-05-27 05:57:29 +0200 |
commit | 35aab8c392ac6ad404bb0d902cca6b50480072da (patch) | |
tree | 035f26e0c3151fbd088b07c6e8140ce6412c5f2e /extensions/BugModal/web/bug_modal.js | |
parent | 087f74073fdc81ec5707f2989c99b34770e864eb (diff) | |
download | bugzilla-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.js | 11 |
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 = []; |