@propeller-commerce/propeller-v2-react-ui 0.4.22 → 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/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
- try {
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
- try {
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);