parent
b308f06af3
commit
b556eda4a0
@ -1,13 +1,14 @@
|
||||
var Handlebars = require('handlebars');
|
||||
|
||||
module.exports = (function(){
|
||||
Handlebars.registerHelper('historyAge', function() {
|
||||
|
||||
var unit = 'days';
|
||||
var age = this.age;
|
||||
|
||||
if (age < 2) {
|
||||
unit = 'hours';
|
||||
age = parseFloat(this.ageHours).toFixed(1);
|
||||
}
|
||||
|
||||
return new Handlebars.SafeString('<dt>Age (when grabbed):</dt><dd>{0} {1}</dd>'.format(age, unit));
|
||||
});
|
||||
}).call(this);
|
@ -1,4 +1,6 @@
|
||||
var Marionette = require('marionette');
|
||||
require('./HistoryDetailsAge');
|
||||
|
||||
module.exports = Marionette.ItemView.extend({template : 'Activity/History/Details/HistoryDetailsViewTemplate'});
|
||||
module.exports = Marionette.ItemView.extend({
|
||||
template : 'Activity/History/Details/HistoryDetailsViewTemplate'
|
||||
});
|
Loading…
Reference in new issue