ember2 progress deprication smashing
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user