Ember.Handlebars.helper 'time', (time, params..., options = {})->
  return '' unless time
  iso = time.toISOString()
  tag = if options.bare then iso else $("<span data-time=\"#{iso}\"></span>").text(moment(iso).format(options.format || 'dd D MMM HH:MM')).get(0).outerHTML
  new Handlebars.SafeString tag
