@kengic/uni 0.6.3-beta.27 → 0.6.3-beta.29

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/dist/util/kg.ts +4 -33
  2. package/package.json +1 -1
package/dist/util/kg.ts CHANGED
@@ -256,42 +256,13 @@ export class Kg {
256
256
  const _rightValue = value[1] as Dayjs;
257
257
 
258
258
  // 左侧日期的字符串
259
- let _leftStringValue = _leftValue.format('YYYY-MM-DD HH:mm:ss');
259
+ let _leftStringValue = _leftValue && _leftValue.isValid() ? _leftValue.format('YYYY-MM-DD') : '';
260
260
  // 右侧日期的字符串
261
261
  let _rightStringValue = '';
262
262
 
263
- switch (true) {
264
- // 左侧日期为空
265
- case !_leftStringValue: {
266
- _rightStringValue = _rightValue.format('YYYY-MM-DD HH:mm:ss');
267
- break;
268
- }
269
-
270
- // 日期格式为 YYYY-MM-DD HH:mm:ss
271
- case /\d\d-\d\d-\d\d \d\d:\d\d:\d\d/.test(_leftStringValue): {
272
- if (_rightValue.isValid()) {
273
- _rightStringValue = _rightValue.add(1, 'second').format('YYYY-MM-DD HH:mm:ss');
274
- }
275
- break;
276
- }
277
-
278
- // 日期格式为 YYYY-MM-DD
279
- case /\d\d-\d\d-\d\d/.test(_leftStringValue): {
280
- _leftStringValue = `${_leftStringValue} 00:00:00`;
281
- if (_rightValue.isValid()) {
282
- _rightStringValue = _rightValue.add(1, 'day').format('YYYY-MM-DD 00:00:00');
283
- }
284
- break;
285
- }
286
-
287
- // 日期格式为 HH:mm:ss
288
- case /\d\d:\d\d:\d\d/.test(_leftStringValue): {
289
- _leftStringValue = `1900-01-01 ${_leftStringValue}`;
290
- if (_rightValue.isValid()) {
291
- _rightStringValue = _rightValue.add(1, 'second').format('1900-01-01 HH:mm:ss');
292
- }
293
- break;
294
- }
263
+ _leftStringValue = `${_leftStringValue} 00:00:00`;
264
+ if (_rightValue && _rightValue.isValid()) {
265
+ _rightStringValue = _rightValue.add(1, 'day').format('YYYY-MM-DD 00:00:00');
295
266
  }
296
267
 
297
268
  if (_leftStringValue) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/uni",
3
- "version": "0.6.3-beta.27",
3
+ "version": "0.6.3-beta.29",
4
4
  "scripts": {
5
5
  "build": "npm run use-node && rimraf dist && vue-tsc && vite build",
6
6
  "------ -------------------------------------------": "",