Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2016-04-07 20:00:19 +0300
committerAlfredo Sumaran <alfredo@gitlab.com>2016-04-07 20:00:19 +0300
commitb19ccdeed45605a7bb79509092b297087d6c6e8c (patch)
tree7906708434c68f4ed02a3c63698ca76c347fd547 /app/assets/javascripts/lib
parent088368ae4d1c41b6e55a8c5e7e5439a9ea323eb2 (diff)
Add datetime_utility.js.coffee
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r--app/assets/javascripts/lib/datetime_utility.js.coffee15
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