@ejfdelgado/ejflab-back 1.26.6 → 1.26.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/srv/MyPdf.mjs +4 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ejfdelgado/ejflab-back",
|
3
|
-
"version": "1.26.
|
3
|
+
"version": "1.26.8",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "git+https://github.com/ejfdelgado/ejflab-back.git"
|
@@ -18,7 +18,7 @@
|
|
18
18
|
"license": "ISC",
|
19
19
|
"private": false,
|
20
20
|
"dependencies": {
|
21
|
-
"@ejfdelgado/ejflab-common": "1.14.
|
21
|
+
"@ejfdelgado/ejflab-common": "1.14.4",
|
22
22
|
"@google-cloud/compute": "^4.7.0",
|
23
23
|
"@google-cloud/firestore": "^7.9.0",
|
24
24
|
"@google-cloud/storage": "^7.11.3",
|
package/srv/MyPdf.mjs
CHANGED
@@ -4,6 +4,7 @@ import { General } from "./common/General.mjs";
|
|
4
4
|
import { MyTemplate } from "@ejfdelgado/ejflab-common/src/MyTemplate.js";
|
5
5
|
import { CsvFormatterFilters } from "@ejfdelgado/ejflab-common/src/CsvFormatterFilters.js";
|
6
6
|
import { MyUtilities } from '@ejfdelgado/ejflab-common/src/MyUtilities.js';
|
7
|
+
import { MyDatesBack } from '@ejfdelgado/ejflab-common/src/MyDatesBack.mjs';
|
7
8
|
|
8
9
|
export class MyPdf {
|
9
10
|
static async localRender(template, model = {}, format = "pdf", extra = [], configuration, launch) {
|
@@ -13,6 +14,9 @@ export class MyPdf {
|
|
13
14
|
}
|
14
15
|
const renderer = new MyTemplate();
|
15
16
|
renderer.registerFunction("json", CsvFormatterFilters.json);
|
17
|
+
renderer.registerFunction("epoch2date", (value, ...args) => {
|
18
|
+
return MyDatesBack.formatDateCompleto(new Date(value), ...args);
|
19
|
+
});
|
16
20
|
for (let i = 0; i < extra.length; i++) {
|
17
21
|
const extraFile = extra[i];
|
18
22
|
const path = MyUtilities.removeRepeatedSlash(`./src/assets/templates/pdf/${extraFile.path}`);
|