@propeller-commerce/propeller-v2-react-ui 0.4.23 → 0.4.24
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/CHANGELOG.md +17 -0
- package/dist/index.cjs +36 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +36 -21
- package/dist/index.js.map +1 -1
- package/dist/pure.cjs +9 -10
- package/dist/pure.cjs.map +1 -1
- package/dist/pure.js +9 -10
- package/dist/pure.js.map +1 -1
- package/package.json +1 -1
package/dist/pure.cjs
CHANGED
|
@@ -448,15 +448,18 @@ function OrderSummary(props) {
|
|
|
448
448
|
}
|
|
449
449
|
return propellerV2CoreUi.formatPrice(price || 0, { symbol: props.currency ?? "\u20AC" });
|
|
450
450
|
}
|
|
451
|
+
function numericDate(dateString) {
|
|
452
|
+
const d = new Date(dateString);
|
|
453
|
+
if (isNaN(d.getTime())) return dateString;
|
|
454
|
+
const day = String(d.getDate()).padStart(2, "0");
|
|
455
|
+
const month = String(d.getMonth() + 1).padStart(2, "0");
|
|
456
|
+
return `${day}-${month}-${d.getFullYear()}`;
|
|
457
|
+
}
|
|
451
458
|
function formatOrderDate(dateString) {
|
|
452
459
|
if (props.formatDate) {
|
|
453
460
|
return props.formatDate(dateString);
|
|
454
461
|
}
|
|
455
|
-
|
|
456
|
-
return new Date(dateString).toLocaleDateString("en-US");
|
|
457
|
-
} catch {
|
|
458
|
-
return dateString;
|
|
459
|
-
}
|
|
462
|
+
return numericDate(dateString);
|
|
460
463
|
}
|
|
461
464
|
const requestDateRaw = order?.postageData?.requestDate;
|
|
462
465
|
let requestDate = "";
|
|
@@ -464,11 +467,7 @@ function OrderSummary(props) {
|
|
|
464
467
|
if (props.formatDate) {
|
|
465
468
|
requestDate = props.formatDate(requestDateRaw);
|
|
466
469
|
} else {
|
|
467
|
-
|
|
468
|
-
requestDate = new Date(requestDateRaw).toLocaleDateString("en-US");
|
|
469
|
-
} catch {
|
|
470
|
-
requestDate = requestDateRaw;
|
|
471
|
-
}
|
|
470
|
+
requestDate = numericDate(requestDateRaw);
|
|
472
471
|
}
|
|
473
472
|
}
|
|
474
473
|
const getCountryName = (code) => propellerV2CoreUi.getCountryName(code, props.countries);
|