@navservice/core 1.82.0 → 1.84.0
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/build/es/helpers/_data.d.ts +4 -4
- package/build/es/helpers/index.d.ts +2 -4
- package/build/es/helpers.js +6 -4
- package/build/es/index.js +14 -0
- package/build/es/utils/_data.d.ts +1 -0
- package/build/es/utils/index.d.ts +1 -0
- package/build/lib/helpers/_data.d.ts +4 -4
- package/build/lib/helpers/index.d.ts +2 -4
- package/build/lib/helpers.cjs +6 -4
- package/build/lib/index.cjs +18 -0
- package/build/lib/utils/_data.d.ts +1 -0
- package/build/lib/utils/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
declare
|
|
2
|
-
get_now_format_number: number;
|
|
3
|
-
verificar_data
|
|
4
|
-
}
|
|
1
|
+
declare class _data {
|
|
2
|
+
static get get_now_format_number(): number;
|
|
3
|
+
static verificar_data(value: number): number;
|
|
4
|
+
}
|
|
5
5
|
export default _data;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _secret from "./_secret";
|
|
2
|
+
import _data from "./_data";
|
|
2
3
|
declare const helpers: {
|
|
3
4
|
set_response: {
|
|
4
5
|
new (): {};
|
|
@@ -144,9 +145,6 @@ declare const helpers: {
|
|
|
144
145
|
}): Promise<string>;
|
|
145
146
|
};
|
|
146
147
|
secret: typeof _secret;
|
|
147
|
-
data:
|
|
148
|
-
get_now_format_number: number;
|
|
149
|
-
verificar_data: (value: number) => number;
|
|
150
|
-
};
|
|
148
|
+
data: typeof _data;
|
|
151
149
|
};
|
|
152
150
|
export default helpers;
|
package/build/es/helpers.js
CHANGED
|
@@ -291,14 +291,16 @@ class _secret {
|
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
const helpers_secret = _secret;
|
|
294
|
-
|
|
295
|
-
get_now_format_number
|
|
296
|
-
|
|
294
|
+
class _data {
|
|
295
|
+
static get get_now_format_number() {
|
|
296
|
+
return Math.floor(Date.now() / 1000);
|
|
297
|
+
}
|
|
298
|
+
static verificar_data(value) {
|
|
297
299
|
const data = new Date(1000 * value);
|
|
298
300
|
if (isNaN(data.getTime())) throw new Error("Timestamp está inválido.");
|
|
299
301
|
return value;
|
|
300
302
|
}
|
|
301
|
-
}
|
|
303
|
+
}
|
|
302
304
|
const helpers_data = _data;
|
|
303
305
|
const helpers = {
|
|
304
306
|
set_response: _set_response,
|
package/build/es/index.js
CHANGED
|
@@ -282,6 +282,20 @@ const _data = class {
|
|
|
282
282
|
var diferencaEmDias = Math.floor(diferenca / 86400000);
|
|
283
283
|
return diferencaEmDias;
|
|
284
284
|
}
|
|
285
|
+
static SET_SECONDS_TO_DD_MM_YYYY_HH_MM(timestamp) {
|
|
286
|
+
const segundos = Number(timestamp);
|
|
287
|
+
if (!Number.isFinite(segundos)) return "-";
|
|
288
|
+
const data = new Date(1000 * segundos);
|
|
289
|
+
if (isNaN(data.getTime())) return "-";
|
|
290
|
+
return data.toLocaleString("pt-BR", {
|
|
291
|
+
timeZone: "America/Sao_Paulo",
|
|
292
|
+
day: "2-digit",
|
|
293
|
+
month: "2-digit",
|
|
294
|
+
year: "numeric",
|
|
295
|
+
hour: "2-digit",
|
|
296
|
+
minute: "2-digit"
|
|
297
|
+
});
|
|
298
|
+
}
|
|
285
299
|
};
|
|
286
300
|
const utils_data = _data;
|
|
287
301
|
class _form {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
declare
|
|
2
|
-
get_now_format_number: number;
|
|
3
|
-
verificar_data
|
|
4
|
-
}
|
|
1
|
+
declare class _data {
|
|
2
|
+
static get get_now_format_number(): number;
|
|
3
|
+
static verificar_data(value: number): number;
|
|
4
|
+
}
|
|
5
5
|
export default _data;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _secret from "./_secret";
|
|
2
|
+
import _data from "./_data";
|
|
2
3
|
declare const helpers: {
|
|
3
4
|
set_response: {
|
|
4
5
|
new (): {};
|
|
@@ -144,9 +145,6 @@ declare const helpers: {
|
|
|
144
145
|
}): Promise<string>;
|
|
145
146
|
};
|
|
146
147
|
secret: typeof _secret;
|
|
147
|
-
data:
|
|
148
|
-
get_now_format_number: number;
|
|
149
|
-
verificar_data: (value: number) => number;
|
|
150
|
-
};
|
|
148
|
+
data: typeof _data;
|
|
151
149
|
};
|
|
152
150
|
export default helpers;
|
package/build/lib/helpers.cjs
CHANGED
|
@@ -440,16 +440,18 @@ class _secret {
|
|
|
440
440
|
/* export default */ const helpers_secret = (_secret);
|
|
441
441
|
|
|
442
442
|
;// CONCATENATED MODULE: ./src/helpers/_data.ts
|
|
443
|
-
|
|
444
|
-
get_now_format_number
|
|
445
|
-
|
|
443
|
+
class _data {
|
|
444
|
+
static get get_now_format_number() {
|
|
445
|
+
return Math.floor(Date.now() / 1000);
|
|
446
|
+
}
|
|
447
|
+
static verificar_data(value) {
|
|
446
448
|
const data = new Date(value * 1000);
|
|
447
449
|
if (isNaN(data.getTime())) {
|
|
448
450
|
throw new Error("Timestamp está inválido.");
|
|
449
451
|
}
|
|
450
452
|
return value; // válido
|
|
451
453
|
}
|
|
452
|
-
}
|
|
454
|
+
}
|
|
453
455
|
/* export default */ const helpers_data = (_data);
|
|
454
456
|
|
|
455
457
|
;// CONCATENATED MODULE: ./src/helpers/index.ts
|
package/build/lib/index.cjs
CHANGED
|
@@ -378,6 +378,24 @@ const _data = class _data {
|
|
|
378
378
|
var diferencaEmDias = Math.floor(diferenca / (1000 * 60 * 60 * 24)); // Calcula a diferença em dias
|
|
379
379
|
return diferencaEmDias;
|
|
380
380
|
}
|
|
381
|
+
static SET_SECONDS_TO_DD_MM_YYYY_HH_MM(timestamp) {
|
|
382
|
+
const segundos = Number(timestamp);
|
|
383
|
+
if (!Number.isFinite(segundos)) {
|
|
384
|
+
return "-";
|
|
385
|
+
}
|
|
386
|
+
const data = new Date(segundos * 1000);
|
|
387
|
+
if (isNaN(data.getTime())) {
|
|
388
|
+
return "-";
|
|
389
|
+
}
|
|
390
|
+
return data.toLocaleString("pt-BR", {
|
|
391
|
+
timeZone: "America/Sao_Paulo",
|
|
392
|
+
day: "2-digit",
|
|
393
|
+
month: "2-digit",
|
|
394
|
+
year: "numeric",
|
|
395
|
+
hour: "2-digit",
|
|
396
|
+
minute: "2-digit"
|
|
397
|
+
});
|
|
398
|
+
}
|
|
381
399
|
};
|
|
382
400
|
/* export default */ const utils_data = (_data);
|
|
383
401
|
|