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

datetime_utility.js.coffee « lib « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ad1d1c704819130185f350661ee8b7e2ce1002be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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