opus-toolkit-components 0.8.3 → 0.8.4

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.
@@ -3797,17 +3797,19 @@ function DatePicker(_ref) {
3797
3797
  const [datePart] = dateString.split(' '); // Remove time if present
3798
3798
 
3799
3799
  if (/^\d{4}-\d{2}-\d{2}$/.test(datePart)) {
3800
- return datePart; // Already in yyyy-MM-dd
3800
+ return datePart; // Already ISO format
3801
3801
  }
3802
3802
  const parts = datePart.split('/');
3803
3803
  if (parts.length !== 3) return '';
3804
- const [a, b, c] = parts.map(p => p.padStart(2, '0'));
3805
- if (parseInt(a, 10) > 12) {
3804
+ const [part1, part2, part3] = parts.map(p => p.padStart(2, '0'));
3805
+ if (parseInt(part1, 10) > 12) {
3806
3806
  // Assume dd/MM/yyyy
3807
- return "".concat(c, "-").concat(b, "-").concat(a);
3807
+ const [day, month, year] = [part1, part2, part3];
3808
+ return "".concat(year, "-").concat(month, "-").concat(day);
3808
3809
  } else {
3809
3810
  // Assume MM/dd/yyyy
3810
- return "".concat(c, "-").concat(a, "-").concat(b);
3811
+ const [month, day, year] = [part1, part2, part3];
3812
+ return "".concat(year, "-").concat(month, "-").concat(day);
3811
3813
  }
3812
3814
  };
3813
3815
  (0,external_react_.useEffect)(() => {
@@ -3820,13 +3822,10 @@ function DatePicker(_ref) {
3820
3822
  const rawValue = e.target.value; // yyyy-MM-dd
3821
3823
  setSelectedDate(rawValue);
3822
3824
  if (onChange && rawValue) {
3823
- const [year, month, day] = rawValue.split('-');
3824
- const formattedValue = "".concat(day, "/").concat(month, "/").concat(year); // dd/MM/yyyy
3825
3825
  onChange({
3826
3826
  target: {
3827
3827
  name,
3828
- value: formattedValue,
3829
- rawValue
3828
+ value: rawValue // Keep value in ISO format for form submission
3830
3829
  }
3831
3830
  });
3832
3831
  }
@@ -12542,4 +12541,4 @@ const Pill = _ref => {
12542
12541
  /******/ })()
12543
12542
  ;
12544
12543
  });
12545
- //# sourceMappingURL=main.3cbe68884c7de90ac040.js.map
12544
+ //# sourceMappingURL=main.4f1c65e3bc1a8de293ea.js.map