@navservice/core 1.83.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/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 {
|
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
|
|