diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-04-07 20:00:19 +0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-04-07 20:00:19 +0300 |
commit | b19ccdeed45605a7bb79509092b297087d6c6e8c (patch) | |
tree | 7906708434c68f4ed02a3c63698ca76c347fd547 /app/assets/javascripts/lib | |
parent | 088368ae4d1c41b6e55a8c5e7e5439a9ea323eb2 (diff) |
Add datetime_utility.js.coffee
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r-- | app/assets/javascripts/lib/datetime_utility.js.coffee | 15 |
1 files changed, 15 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..ef9406fc331 --- /dev/null +++ b/app/assets/javascripts/lib/datetime_utility.js.coffee @@ -0,0 +1,15 @@ +((w) -> + + w.gl ?= {} + w.gl.utils ?= {} + + w.gl.utils.formatDate = (datetime) -> + dateFormat(datetime, 'mmm d, yyyy h:MMtt Z') + + w.gl.utils.updateFormatDate = ($timeagoEls) -> + $timeagoEls.each( -> + $el = $(@) + $el.attr('title', gl.utils.formatDate($el.attr('datetime'))) + ) + +) window |