baaz-custom-components 5.2.9 → 5.2.10

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.js CHANGED
@@ -2101,6 +2101,12 @@ var Filters = ({
2101
2101
  const selectedColumns = (0, import_react5.useMemo)(() => {
2102
2102
  return conditions.map((c) => c.column).filter(Boolean);
2103
2103
  }, [conditions]);
2104
+ const toLocalDateTimeString = (epoch) => {
2105
+ const date = new Date(epoch);
2106
+ const offset = date.getTimezoneOffset() * 60 * 1e3;
2107
+ const localDate = new Date(date.getTime() - offset);
2108
+ return localDate.toISOString().slice(0, 16);
2109
+ };
2104
2110
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "relative", ref: filterRef, children: [
2105
2111
  /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
2106
2112
  "button",
@@ -2274,7 +2280,9 @@ var Filters = ({
2274
2280
  "input",
2275
2281
  {
2276
2282
  type: "datetime-local",
2277
- value: ((_g = condition.value) == null ? void 0 : _g.start) ? new Date(condition.value.start).toISOString().split("T")[0] : "",
2283
+ value: ((_g = condition.value) == null ? void 0 : _g.start) ? toLocalDateTimeString(
2284
+ condition.value.start
2285
+ ) : "",
2278
2286
  onChange: (e) => updateCondition(condition.id, {
2279
2287
  value: __spreadProps(__spreadValues({}, condition.value), {
2280
2288
  start: new Date(e.target.value).getTime()
@@ -2287,7 +2295,9 @@ var Filters = ({
2287
2295
  "input",
2288
2296
  {
2289
2297
  type: "datetime-local",
2290
- value: ((_h = condition.value) == null ? void 0 : _h.end) ? new Date(condition.value.end).toISOString().split("T")[0] : "",
2298
+ value: ((_h = condition.value) == null ? void 0 : _h.end) ? toLocalDateTimeString(
2299
+ condition.value.end
2300
+ ) : "",
2291
2301
  onChange: (e) => updateCondition(condition.id, {
2292
2302
  value: __spreadProps(__spreadValues({}, condition.value), {
2293
2303
  end: new Date(e.target.value).getTime()
package/dist/index.mjs CHANGED
@@ -2070,6 +2070,12 @@ var Filters = ({
2070
2070
  const selectedColumns = useMemo3(() => {
2071
2071
  return conditions.map((c) => c.column).filter(Boolean);
2072
2072
  }, [conditions]);
2073
+ const toLocalDateTimeString = (epoch) => {
2074
+ const date = new Date(epoch);
2075
+ const offset = date.getTimezoneOffset() * 60 * 1e3;
2076
+ const localDate = new Date(date.getTime() - offset);
2077
+ return localDate.toISOString().slice(0, 16);
2078
+ };
2073
2079
  return /* @__PURE__ */ jsxs17("div", { className: "relative", ref: filterRef, children: [
2074
2080
  /* @__PURE__ */ jsxs17(
2075
2081
  "button",
@@ -2243,7 +2249,9 @@ var Filters = ({
2243
2249
  "input",
2244
2250
  {
2245
2251
  type: "datetime-local",
2246
- value: ((_g = condition.value) == null ? void 0 : _g.start) ? new Date(condition.value.start).toISOString().split("T")[0] : "",
2252
+ value: ((_g = condition.value) == null ? void 0 : _g.start) ? toLocalDateTimeString(
2253
+ condition.value.start
2254
+ ) : "",
2247
2255
  onChange: (e) => updateCondition(condition.id, {
2248
2256
  value: __spreadProps(__spreadValues({}, condition.value), {
2249
2257
  start: new Date(e.target.value).getTime()
@@ -2256,7 +2264,9 @@ var Filters = ({
2256
2264
  "input",
2257
2265
  {
2258
2266
  type: "datetime-local",
2259
- value: ((_h = condition.value) == null ? void 0 : _h.end) ? new Date(condition.value.end).toISOString().split("T")[0] : "",
2267
+ value: ((_h = condition.value) == null ? void 0 : _h.end) ? toLocalDateTimeString(
2268
+ condition.value.end
2269
+ ) : "",
2260
2270
  onChange: (e) => updateCondition(condition.id, {
2261
2271
  value: __spreadProps(__spreadValues({}, condition.value), {
2262
2272
  end: new Date(e.target.value).getTime()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baaz-custom-components",
3
- "version": "5.2.9",
3
+ "version": "5.2.10",
4
4
  "private": false,
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.js",