Improved humanTime helper method.
This commit is contained in:
parent
7adc2ea919
commit
6366629205
1 changed files with 3 additions and 2 deletions
|
@ -109,10 +109,11 @@ class App extends Spine.Controller
|
||||||
isHtmlEscape = true
|
isHtmlEscape = true
|
||||||
timestamp = App.i18n.translateTimestamp(result)
|
timestamp = App.i18n.translateTimestamp(result)
|
||||||
escalation = false
|
escalation = false
|
||||||
if attribute_config.class && attribute_config.class.match 'escalation'
|
cssClass = attribute_config.class || ''
|
||||||
|
if cssClass.match 'escalation'
|
||||||
escalation = true
|
escalation = true
|
||||||
humanTime = App.PrettyDate.humanTime(result, escalation)
|
humanTime = App.PrettyDate.humanTime(result, escalation)
|
||||||
result = "<time class=\"humanTimeFromNow #{attribute_config.class}\" data-time=\"#{result}\" data-tooltip=\"#{timestamp}\">#{humanTime}</time>"
|
result = "<time class=\"humanTimeFromNow #{cssClass}\" data-time=\"#{result}\" data-tooltip=\"#{timestamp}\">#{humanTime}</time>"
|
||||||
|
|
||||||
if !isHtmlEscape && typeof result is 'string'
|
if !isHtmlEscape && typeof result is 'string'
|
||||||
result = App.Utils.htmlEscape(result)
|
result = App.Utils.htmlEscape(result)
|
||||||
|
|
Loading…
Reference in a new issue