@mcurros2/microm 1.1.150-0 → 1.1.152-0
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.d.ts.map +1 -1
- package/dist/index.js +17 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -805,23 +805,25 @@ function $da685baa3bcc0ab0$export$f901ae239e30212a(columnName, sourceValue, colu
|
|
|
805
805
|
valueDescriptionToSet = sourceValue.valueDescription;
|
|
806
806
|
} else valueToSet = sourceValue;
|
|
807
807
|
// Convert string to Date if necessary
|
|
808
|
-
if ((0, $lTNXP.isIn)(column.type, "date", "datetime", "datetime2", "smalldatetime") && typeof valueToSet === "string" && !(0, $lTNXP.isIn)(columnName, "dt_lu")) {
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
valueToSet
|
|
816
|
-
} catch (e) {
|
|
817
|
-
console.log(`Error converting string to Date: ${e}`, e);
|
|
808
|
+
if ((0, $lTNXP.isIn)(column.type, "date", "datetime", "datetime2", "smalldatetime") && typeof valueToSet === "string" && !(0, $lTNXP.isIn)(columnName, "dt_lu")) try {
|
|
809
|
+
// FIX to handle dayjs issue parsing string ISO 8601 with trimmed zeroes at the end of the milliseconds
|
|
810
|
+
// 2025-07-02T16:58:45.57 57 here means 570 milliseconds but dayJS has a bug and parses it as 57 milliseconds
|
|
811
|
+
const endsWithDotAndTwoDigits = /\.\d{2}$/;
|
|
812
|
+
if (valueToSet.length === 22 && endsWithDotAndTwoDigits.test(valueToSet)) valueToSet = valueToSet + "0"; // add the missing zero to milliseconds
|
|
813
|
+
else {
|
|
814
|
+
const endsWithDotAndOneDigits = /\.\d{1}$/;
|
|
815
|
+
if (valueToSet.length === 21 && endsWithDotAndOneDigits.test(valueToSet)) valueToSet = valueToSet + "00"; // add the missing two zeros to milliseconds
|
|
818
816
|
}
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
if (valueDescriptionToSet) column.valueDescription = valueDescriptionToSet;
|
|
817
|
+
// dayjs is used here for compatibility with mantine calendar component which formats the date with dayjs
|
|
818
|
+
valueToSet = (0, ($parcel$interopDefault($b4te3$dayjs)))(valueToSet).toDate();
|
|
819
|
+
} catch (e) {
|
|
820
|
+
console.log(`Error converting string to Date: ${e}`, e);
|
|
824
821
|
}
|
|
822
|
+
if (!(0, $eRkDL.hasValue)(valueToSet) && ignoreEmptySourceValues) return;
|
|
823
|
+
// MMC: specific for entityAPI getData method, where the json array comes as an escaped string
|
|
824
|
+
if (convertStringArray && column.isArray && typeof valueToSet === "string") column.value = JSON.parse(valueToSet);
|
|
825
|
+
else column.value = valueToSet;
|
|
826
|
+
if (valueDescriptionToSet) column.valueDescription = valueDescriptionToSet;
|
|
825
827
|
}
|
|
826
828
|
function $da685baa3bcc0ab0$export$b7771d60d308862f(columns, sourceValues, filters, ignoreInexistentColumns = false, ignoreEmptySourceValues = false, convertStringArray = false) {
|
|
827
829
|
if (!sourceValues) return;
|