ember2 progress deprication smashing

This commit is contained in:
2015-08-26 19:56:44 +02:00
parent 39a21ec705
commit bb22dffef2
48 changed files with 139 additions and 146 deletions
@@ -1,10 +1,10 @@
Ember.Handlebars.helper 'time', (time, params..., options = {})->
return '' unless time
App.TimeHelper = Ember.Helper.helper (params, options)->
return '' unless time = params[0]
time = new Date(time) if typeof(time) is "string"
iso = time.toISOString()
if options.hash.format
format_string = "data-time-format=\"#{options.hash.format}\""
if options.format
format_string = "data-time-format=\"#{options.format}\""
else
format_string = ''
tag = if options.bare then iso else $("<span data-time=\"#{iso}\" #{format_string}></span>").text(moment(iso).format(options.hash.format || 'dd D MMM hh:mm')).get(0).outerHTML
tag = if options.bare then iso else $("<span data-time=\"#{iso}\" #{format_string}></span>").text(moment(iso).format(options.format || 'dd D MMM hh:mm')).get(0).outerHTML
new Handlebars.SafeString tag