Add datetime_utility.js.coffee
This commit is contained in:
parent
088368ae4d
commit
b19ccdeed4
1 changed files with 15 additions and 0 deletions
15
app/assets/javascripts/lib/datetime_utility.js.coffee
Normal file
15
app/assets/javascripts/lib/datetime_utility.js.coffee
Normal file
|
@ -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
|
Loading…
Reference in a new issue