ecotransac-shared-js 1.2.13 → 1.2.14
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/dist/index.js +9 -2
- package/dist/index.mjs +9 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -417,8 +417,15 @@ var formatAddress = (address) => `${address.address}, ${address.postalCode} ${ad
|
|
|
417
417
|
var formatSeconds = (seconds) => {
|
|
418
418
|
const hours = Math.floor(seconds / 3600);
|
|
419
419
|
const minutes = Math.floor((seconds - hours * 3600) / 60);
|
|
420
|
-
|
|
421
|
-
|
|
420
|
+
const secondsLeft = seconds - hours * 3600 - minutes * 60;
|
|
421
|
+
const hoursLabel = hours > 0 ? `${hours} heure${hours > 1 ? "s" : ""}` : null;
|
|
422
|
+
const minutesLabel = minutes > 0 ? `${minutes} minute${minutes > 1 ? "s" : ""}` : null;
|
|
423
|
+
const secondsLabel = secondsLeft > 0 ? `${secondsLeft} seconde${secondsLeft > 1 ? "s" : ""}` : null;
|
|
424
|
+
const labels = [hoursLabel, minutesLabel, secondsLabel].filter(Boolean);
|
|
425
|
+
if (labels.length > 1) {
|
|
426
|
+
labels.splice(-1, 0, "et");
|
|
427
|
+
}
|
|
428
|
+
return labels.join(" ");
|
|
422
429
|
};
|
|
423
430
|
var formatReference = (reference) => `R\xE9f. ${reference.toString().padStart(5, "0")}`;
|
|
424
431
|
var formatDate = (date, withTime = false) => {
|
package/dist/index.mjs
CHANGED
|
@@ -326,8 +326,15 @@ var formatAddress = (address) => `${address.address}, ${address.postalCode} ${ad
|
|
|
326
326
|
var formatSeconds = (seconds) => {
|
|
327
327
|
const hours = Math.floor(seconds / 3600);
|
|
328
328
|
const minutes = Math.floor((seconds - hours * 3600) / 60);
|
|
329
|
-
|
|
330
|
-
|
|
329
|
+
const secondsLeft = seconds - hours * 3600 - minutes * 60;
|
|
330
|
+
const hoursLabel = hours > 0 ? `${hours} heure${hours > 1 ? "s" : ""}` : null;
|
|
331
|
+
const minutesLabel = minutes > 0 ? `${minutes} minute${minutes > 1 ? "s" : ""}` : null;
|
|
332
|
+
const secondsLabel = secondsLeft > 0 ? `${secondsLeft} seconde${secondsLeft > 1 ? "s" : ""}` : null;
|
|
333
|
+
const labels = [hoursLabel, minutesLabel, secondsLabel].filter(Boolean);
|
|
334
|
+
if (labels.length > 1) {
|
|
335
|
+
labels.splice(-1, 0, "et");
|
|
336
|
+
}
|
|
337
|
+
return labels.join(" ");
|
|
331
338
|
};
|
|
332
339
|
var formatReference = (reference) => `R\xE9f. ${reference.toString().padStart(5, "0")}`;
|
|
333
340
|
var formatDate = (date, withTime = false) => {
|