diff options
author | Jacob Schatz <jschatz1@gmail.com> | 2016-04-12 22:28:55 +0300 |
---|---|---|
committer | Jacob Schatz <jschatz1@gmail.com> | 2016-04-12 22:28:55 +0300 |
commit | 20418dc7dae516943253fd4a603e2b96ed25559e (patch) | |
tree | ff03d09fe7abd31baa46bada81658dffe3d8c26f /app/assets/javascripts/lib | |
parent | 66e6052b93cf588bb04633fde9fb99097e2cf60d (diff) | |
parent | 44727525952f22c2234d2991e20f4f4f8bac3221 (diff) |
Merge branch 'issue_14206' into 'master'
Fix datetimes on tooltips
Closes #14206
Updates tooltip datetimes on `.timeago()` instances.
**Inline notes**
![Screen_Shot_2016-04-07_at_1.25.12_PM](/uploads/2f55390a7e91dabf75e71fe3bda91849/Screen_Shot_2016-04-07_at_1.25.12_PM.png)
**Existing and new notes**
![Screen_Shot_2016-04-07_at_1.24.49_PM](/uploads/202bb7476738eb048f2d94abb68174e7/Screen_Shot_2016-04-07_at_1.24.49_PM.png)
**Issuable dates**
![Screen_Shot_2016-04-07_at_1.24.32_PM](/uploads/80fd5cc3c06fade0b1c615bc7b7611a8/Screen_Shot_2016-04-07_at_1.24.32_PM.png)
**Build dates**
![Screen_Shot_2016-04-07_at_1.25.02_PM](/uploads/832f43284005ea610a3ad54a49b97104/Screen_Shot_2016-04-07_at_1.25.02_PM.png)
See merge request !3497
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r-- | app/assets/javascripts/lib/datetime_utility.js.coffee | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/datetime_utility.js.coffee b/app/assets/javascripts/lib/datetime_utility.js.coffee new file mode 100644 index 00000000000..ad1d1c70481 --- /dev/null +++ b/app/assets/javascripts/lib/datetime_utility.js.coffee @@ -0,0 +1,17 @@ +((w) -> + + w.gl ?= {} + w.gl.utils ?= {} + + w.gl.utils.formatDate = (datetime) -> + dateFormat(datetime, 'mmm d, yyyy h:MMtt Z') + + w.gl.utils.localTimeAgo = ($timeagoEls, setTimeago = true) -> + $timeagoEls.each( -> + $el = $(@) + $el.attr('title', gl.utils.formatDate($el.attr('datetime'))) + ) + + $timeagoEls.timeago() if setTimeago + +) window |