adminforth 1.3.8 → 1.3.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.
@@ -47,6 +47,9 @@ class SQLiteConnector extends AdminForthBaseConnector implements IAdminForthData
47
47
  } else if (baseType == 'boolean') {
48
48
  field.type = AdminForthDataTypes.BOOLEAN;
49
49
  field._underlineType = 'boolean';
50
+ } else if (baseType == 'datetime') {
51
+ field.type = AdminForthDataTypes.DATETIME;
52
+ field._underlineType = 'datetime';
50
53
  } else {
51
54
  field.type = 'unknown'
52
55
  }
@@ -68,6 +71,8 @@ class SQLiteConnector extends AdminForthBaseConnector implements IAdminForthData
68
71
  return dayjs.unix(+value).toISOString();
69
72
  } else if (field._underlineType == 'varchar') {
70
73
  return dayjs(value).toISOString();
74
+ } else if (field._underlineType == 'datetime') {
75
+ return dayjs(value).toISOString();
71
76
  } else {
72
77
  throw new Error(`AdminForth does not support row type: ${field._underlineType} for timestamps, use VARCHAR (with iso strings) or TIMESTAMP/INT (with unix timestamps). Issue in field "${field.name}"`);
73
78
  }
@@ -102,6 +107,8 @@ class SQLiteConnector extends AdminForthBaseConnector implements IAdminForthData
102
107
  } else if (field._underlineType == 'varchar') {
103
108
  // value is iso string now, convert to unix timestamp
104
109
  return dayjs(value).toISOString();
110
+ } else {
111
+ return value;
105
112
  }
106
113
  } else if (field.type == AdminForthDataTypes.BOOLEAN) {
107
114
  return value ? 1 : 0;
@@ -75,6 +75,10 @@ class SQLiteConnector extends AdminForthBaseConnector {
75
75
  field.type = AdminForthDataTypes.BOOLEAN;
76
76
  field._underlineType = 'boolean';
77
77
  }
78
+ else if (baseType == 'datetime') {
79
+ field.type = AdminForthDataTypes.DATETIME;
80
+ field._underlineType = 'datetime';
81
+ }
78
82
  else {
79
83
  field.type = 'unknown';
80
84
  }
@@ -98,6 +102,9 @@ class SQLiteConnector extends AdminForthBaseConnector {
98
102
  else if (field._underlineType == 'varchar') {
99
103
  return dayjs(value).toISOString();
100
104
  }
105
+ else if (field._underlineType == 'datetime') {
106
+ return dayjs(value).toISOString();
107
+ }
101
108
  else {
102
109
  throw new Error(`AdminForth does not support row type: ${field._underlineType} for timestamps, use VARCHAR (with iso strings) or TIMESTAMP/INT (with unix timestamps). Issue in field "${field.name}"`);
103
110
  }
@@ -134,6 +141,9 @@ class SQLiteConnector extends AdminForthBaseConnector {
134
141
  // value is iso string now, convert to unix timestamp
135
142
  return dayjs(value).toISOString();
136
143
  }
144
+ else {
145
+ return value;
146
+ }
137
147
  }
138
148
  else if (field.type == AdminForthDataTypes.BOOLEAN) {
139
149
  return value ? 1 : 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.3.8",
3
+ "version": "1.3.10",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",