zet-lib 1.2.11 → 1.2.13
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/lib/Util.js +10 -0
- package/lib/index.js +2 -0
- package/lib/zRoute.js +6 -1
- package/package.json +1 -1
package/lib/Util.js
CHANGED
|
@@ -94,6 +94,15 @@ Util.timeSql = function (date, format) {
|
|
|
94
94
|
} else return ''
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
//moment('2017-11-30T15:00:00-07:00').diff(moment('2017-05-31T15:00:00-07:00'), 'months')
|
|
98
|
+
Util.dateDiff = (start, end, format = 'months') => {
|
|
99
|
+
let count = 0
|
|
100
|
+
if (start && end) {
|
|
101
|
+
count = moment(end).diff(moment(start), format, true)
|
|
102
|
+
}
|
|
103
|
+
return count
|
|
104
|
+
}
|
|
105
|
+
|
|
97
106
|
Util.getDate = function (date) {
|
|
98
107
|
date = date + '' || ''
|
|
99
108
|
if (date != '') {
|
|
@@ -1175,6 +1184,7 @@ Util.sortArray = (arr, key) => {
|
|
|
1175
1184
|
}
|
|
1176
1185
|
return 0
|
|
1177
1186
|
}
|
|
1187
|
+
|
|
1178
1188
|
return arr.sort(compare)
|
|
1179
1189
|
}
|
|
1180
1190
|
|
package/lib/index.js
CHANGED
package/lib/zRoute.js
CHANGED
|
@@ -193,7 +193,12 @@ zRoute.post = (req, res, MYMODEL, routeName, body) => {
|
|
|
193
193
|
|
|
194
194
|
case 'lexical':
|
|
195
195
|
post[routeName][key] = JSON.stringify(post[routeName][key])
|
|
196
|
-
|
|
196
|
+
break
|
|
197
|
+
|
|
198
|
+
case 'select':
|
|
199
|
+
if (!post[routeName][key]) {
|
|
200
|
+
post[routeName][key] = 0
|
|
201
|
+
}
|
|
197
202
|
break
|
|
198
203
|
|
|
199
204
|
case 'table':
|