@nocobase/utils 1.6.0-beta.9 → 1.7.0-alpha.1

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.
Files changed (2) hide show
  1. package/lib/date.js +3 -3
  2. package/package.json +2 -2
package/lib/date.js CHANGED
@@ -99,19 +99,19 @@ const toMoment = /* @__PURE__ */ __name((val, options) => {
99
99
  if (!val) {
100
100
  return;
101
101
  }
102
- const offset = options.utcOffset !== void 0 ? options.utcOffset : -1 * (/* @__PURE__ */ new Date()).getTimezoneOffset();
102
+ const offset = options.utcOffset;
103
103
  const { gmt, picker, utc = true } = options;
104
104
  if ((0, import_dayjs.dayjs)(val).isValid()) {
105
105
  if (!utc) {
106
106
  return (0, import_dayjs.dayjs)(val);
107
107
  }
108
108
  if (import_dayjs.dayjs.isDayjs(val)) {
109
- return val.utcOffset(offsetFromString(offset));
109
+ return offset ? val.utcOffset(offsetFromString(offset)) : val;
110
110
  }
111
111
  if (gmt) {
112
112
  return (0, import_dayjs.dayjs)(val).utcOffset(0);
113
113
  }
114
- return (0, import_dayjs.dayjs)(val).utcOffset(offsetFromString(offset));
114
+ return offset ? (0, import_dayjs.dayjs)(val).utcOffset(offsetFromString(offset)) : (0, import_dayjs.dayjs)(val);
115
115
  } else {
116
116
  return convertQuarterToFirstDay(val);
117
117
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/utils",
3
- "version": "1.6.0-beta.9",
3
+ "version": "1.7.0-alpha.1",
4
4
  "main": "lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "license": "AGPL-3.0",
@@ -16,5 +16,5 @@
16
16
  "multer": "^1.4.5-lts.1",
17
17
  "object-path": "^0.11.8"
18
18
  },
19
- "gitHead": "eb1ff948fcf7a51175626a1a56a8b8d9b90be006"
19
+ "gitHead": "e411c9728b4d1f16b0beac16e40dd3499352b052"
20
20
  }