       .pluck('geoname')
       .groupBy('id')
       .values()
-      .map((x)-> x[0])
+      .map((x) -> x[0])
       .value()
     incident =
       locations: locations

    $toTopButton.addClass('off-canvas')
, 50

export pluralize = (word, count, showCount=true)->
  if Number(count) isnt 1
    word += "s"
  if showCount then "#{count} #{word}" else word

export formatDateRange = (dateRange, readable)->
  dateRange ?= ''
  start = moment.utc(dateRange.start)
  end = moment.utc(dateRange.end)

  WGST: '-0200'
  WGT: '-0300'

export regexEscape = (s) ->
  # Based on bobince's regex escape function.
  # source: http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript/3561711#3561711
  s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')
