Added authorization server and backup of JSReport config. IO-585
This commit is contained in:
14
jsreport/data/_globals/helpers.js/config.json
Normal file
14
jsreport/data/_globals/helpers.js/config.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "helpers.js",
|
||||
"creationDate": {
|
||||
"$$date": 1609960774906
|
||||
},
|
||||
"modificationDate": {
|
||||
"$$date": 1609960781053
|
||||
},
|
||||
"shortid": "a49TcoN",
|
||||
"_id": "1lAwHKwaeG3TJBTT",
|
||||
"$entitySet": "assets",
|
||||
"inheritedReadPermissions": [],
|
||||
"inheritedEditPermissions": []
|
||||
}
|
||||
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