@nocobase/database 1.5.0-beta.17 → 1.5.0-beta.19

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.
@@ -52,7 +52,7 @@ const _UnixTimestampField = class _UnixTimestampField extends import_date_field.
52
52
  if (accuracy === "millisecond") {
53
53
  rationalNumber = 1;
54
54
  }
55
- return Math.floor(new Date(val).getTime() / rationalNumber);
55
+ return Math.floor(typeof val === "number" ? val : new Date(val).getTime() / rationalNumber);
56
56
  }
57
57
  additionalSequelizeOptions() {
58
58
  var _a, _b, _c, _d, _e;
@@ -71,16 +71,19 @@ const _UnixTimestampField = class _UnixTimestampField extends import_date_field.
71
71
  return {
72
72
  get() {
73
73
  const value = this.getDataValue(name);
74
- if (value === null || value === void 0) {
74
+ if (value == null) {
75
75
  return value;
76
76
  }
77
77
  return new Date(value * rationalNumber);
78
78
  },
79
79
  set(value) {
80
- if (value === null || value === void 0) {
80
+ if (value == null) {
81
81
  this.setDataValue(name, value);
82
82
  } else {
83
- this.setDataValue(name, Math.floor(new Date(value).getTime() / rationalNumber));
83
+ this.setDataValue(
84
+ name,
85
+ Math.floor(typeof value === "number" ? value : new Date(value).getTime() / rationalNumber)
86
+ );
84
87
  }
85
88
  }
86
89
  };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@nocobase/database",
3
- "version": "1.5.0-beta.17",
3
+ "version": "1.5.0-beta.19",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
7
7
  "license": "AGPL-3.0",
8
8
  "dependencies": {
9
- "@nocobase/logger": "1.5.0-beta.17",
10
- "@nocobase/utils": "1.5.0-beta.17",
9
+ "@nocobase/logger": "1.5.0-beta.19",
10
+ "@nocobase/utils": "1.5.0-beta.19",
11
11
  "async-mutex": "^0.3.2",
12
12
  "chalk": "^4.1.1",
13
13
  "cron-parser": "4.4.0",
@@ -38,5 +38,5 @@
38
38
  "url": "git+https://github.com/nocobase/nocobase.git",
39
39
  "directory": "packages/database"
40
40
  },
41
- "gitHead": "5de21d251f1c40b9f8bf43c255e023293da7a639"
41
+ "gitHead": "a564836d60b070f0ba1fcc0fb6a2a5c647675e13"
42
42
  }