Added authorization server and backup of JSReport config. IO-585
This commit is contained in:
25
jsreport/data/_globals/helpers.js/content.js
Normal file
25
jsreport/data/_globals/helpers.js/content.js
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
const moment = require('moment')
|
||||
|
||||
function formatReportDate (date) {
|
||||
return moment(date).format('YYYY MMMM DD')
|
||||
}
|
||||
|
||||
function now() {
|
||||
return new Date().toLocaleDateString()
|
||||
}
|
||||
|
||||
function nowPlus20Days() {
|
||||
var date = new Date()
|
||||
date.setDate(date.getDate() + 20);
|
||||
return date.toLocaleDateString();
|
||||
}
|
||||
|
||||
function total(items) {
|
||||
var sum = 0
|
||||
items.forEach(function (i) {
|
||||
console.log('Calculating item ' + i.name + '; you should see this message in debug run')
|
||||
sum += i.price
|
||||
})
|
||||
return sum
|
||||
}
|
||||
Reference in New Issue
Block a user