@mcurros2/microm 1.1.138-0 → 1.1.140-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 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6310,17 +6310,13 @@ function $571203341efec15f$export$f5dd818bff069720(value, locale) {
|
|
|
6310
6310
|
return new Intl.NumberFormat(locale).format(Number(value));
|
|
6311
6311
|
}
|
|
6312
6312
|
function $571203341efec15f$export$5dd6539d90141996(value) {
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
const formattedOffset = `${sign}${hours.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}`;
|
|
6321
|
-
if (formattedOffset) return new Date(`${isoString}${formattedOffset}`);
|
|
6322
|
-
}
|
|
6323
|
-
return new Date(value);
|
|
6313
|
+
// If the value already includes an explicit timezone indicator, parse as is.
|
|
6314
|
+
if (value.endsWith("Z") || value.includes("GMT") || value.includes("GMT+") || value.includes("GMT-")) return new Date(value);
|
|
6315
|
+
// Otherwise, assume the date string is in local time.
|
|
6316
|
+
// Convert local date to UTC by adding the timezone offset.
|
|
6317
|
+
const localDate = new Date(value);
|
|
6318
|
+
const utcTime = localDate.getTime() + localDate.getTimezoneOffset() * 60000;
|
|
6319
|
+
return new Date(utcTime);
|
|
6324
6320
|
}
|
|
6325
6321
|
function $571203341efec15f$export$62c5cbf81b90da20(value, sqlType, locale) {
|
|
6326
6322
|
if (value === null) return "null";
|
|
@@ -6430,10 +6426,18 @@ const $74f29643e1a74520$export$da03655abff5c59b = {
|
|
|
6430
6426
|
function $74f29643e1a74520$export$6f2f7bc6c278ece1(props) {
|
|
6431
6427
|
const { initialLocale: initialLocale } = (0, $b4te3$mantinecore.useComponentDefaultProps)("useLocaleFormat", $74f29643e1a74520$export$da03655abff5c59b, props);
|
|
6432
6428
|
const [locale, setLocale] = (0, $b4te3$react.useState)(initialLocale);
|
|
6433
|
-
const formatValue = (0, $b4te3$react.useCallback)((value, sqlType)
|
|
6429
|
+
const formatValue = (0, $b4te3$react.useCallback)(function(value, sqlType) {
|
|
6430
|
+
const result = (0, $7ttm6.formatSQLValue)(value, sqlType, locale);
|
|
6431
|
+
return result;
|
|
6432
|
+
}, [
|
|
6434
6433
|
locale
|
|
6435
6434
|
]);
|
|
6436
|
-
const getNativeValue = (0, $b4te3$react.useCallback)((value, sqlType)
|
|
6435
|
+
const getNativeValue = (0, $b4te3$react.useCallback)(function(value, sqlType) {
|
|
6436
|
+
const result = (0, $7ttm6.convertToNativeValue)(value, sqlType);
|
|
6437
|
+
return result;
|
|
6438
|
+
}, [
|
|
6439
|
+
locale
|
|
6440
|
+
]); // locale is here so the values captured here are in sync with formatValue
|
|
6437
6441
|
const formatColumnValue = (0, $b4te3$react.useCallback)((col)=>{
|
|
6438
6442
|
const result = (0, $7ttm6.formatSQLValue)(col.value, col.type, locale);
|
|
6439
6443
|
return result === "null" ? "" : result;
|