@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.js
CHANGED
|
@@ -426,15 +426,18 @@ function OrderSummary(props) {
|
|
|
426
426
|
}
|
|
427
427
|
return formatPrice(price || 0, { symbol: props.currency ?? "\u20AC" });
|
|
428
428
|
}
|
|
429
|
+
function numericDate(dateString) {
|
|
430
|
+
const d = new Date(dateString);
|
|
431
|
+
if (isNaN(d.getTime())) return dateString;
|
|
432
|
+
const day = String(d.getDate()).padStart(2, "0");
|
|
433
|
+
const month = String(d.getMonth() + 1).padStart(2, "0");
|
|
434
|
+
return `${day}-${month}-${d.getFullYear()}`;
|
|
435
|
+
}
|
|
429
436
|
function formatOrderDate(dateString) {
|
|
430
437
|
if (props.formatDate) {
|
|
431
438
|
return props.formatDate(dateString);
|
|
432
439
|
}
|
|
433
|
-
|
|
434
|
-
return new Date(dateString).toLocaleDateString("en-US");
|
|
435
|
-
} catch {
|
|
436
|
-
return dateString;
|
|
437
|
-
}
|
|
440
|
+
return numericDate(dateString);
|
|
438
441
|
}
|
|
439
442
|
const requestDateRaw = order?.postageData?.requestDate;
|
|
440
443
|
let requestDate = "";
|
|
@@ -442,11 +445,7 @@ function OrderSummary(props) {
|
|
|
442
445
|
if (props.formatDate) {
|
|
443
446
|
requestDate = props.formatDate(requestDateRaw);
|
|
444
447
|
} else {
|
|
445
|
-
|
|
446
|
-
requestDate = new Date(requestDateRaw).toLocaleDateString("en-US");
|
|
447
|
-
} catch {
|
|
448
|
-
requestDate = requestDateRaw;
|
|
449
|
-
}
|
|
448
|
+
requestDate = numericDate(requestDateRaw);
|
|
450
449
|
}
|
|
451
450
|
}
|
|
452
451
|
const getCountryName$1 = (code) => getCountryName(code, props.countries);
|