@tuya-miniapp/smart-ui 2.6.0-beta-3 → 2.6.0-beta-4

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.
@@ -235,7 +235,7 @@ SmartComponent({
235
235
  result.splice(2, 3);
236
236
  return result;
237
237
  },
238
- correctValue(value) {
238
+ correctValue(value, isOutSide) {
239
239
  const { data } = this;
240
240
  // validate value
241
241
  const isDateType = data.type !== 'time';
@@ -257,6 +257,9 @@ SmartComponent({
257
257
  }
258
258
  hour = padZero(range(hour, data.minHour, data.maxHour));
259
259
  minute = padZero(range(minute, data.minMinute, data.maxMinute));
260
+ if (isOutSide && Number(hour) === 24) {
261
+ hour = 0;
262
+ }
260
263
  return `${hour}:${minute}`;
261
264
  }
262
265
  // date type
@@ -344,7 +347,7 @@ SmartComponent({
344
347
  }
345
348
  value = new Date(year, month - 1, date, hour, minute);
346
349
  }
347
- value = this.correctValue(value);
350
+ value = this.correctValue(value, true);
348
351
  this.updateColumnValue(value).then(() => {
349
352
  picker.value = value;
350
353
  this.$emit('input', value);
@@ -269,7 +269,7 @@ var defaultFormatter = function (type, value) {
269
269
  result.splice(2, 3);
270
270
  return result;
271
271
  },
272
- correctValue: function (value) {
272
+ correctValue: function (value, isOutSide) {
273
273
  var data = this.data;
274
274
  // validate value
275
275
  var isDateType = data.type !== 'time';
@@ -291,6 +291,9 @@ var defaultFormatter = function (type, value) {
291
291
  }
292
292
  hour = padZero((0, utils_1.range)(hour, data.minHour, data.maxHour));
293
293
  minute = padZero((0, utils_1.range)(minute, data.minMinute, data.maxMinute));
294
+ if (isOutSide && Number(hour) === 24) {
295
+ hour = 0;
296
+ }
294
297
  return "".concat(hour, ":").concat(minute);
295
298
  }
296
299
  // date type
@@ -380,7 +383,7 @@ var defaultFormatter = function (type, value) {
380
383
  }
381
384
  value = new Date(year, month - 1, date, hour, minute);
382
385
  }
383
- value = this.correctValue(value);
386
+ value = this.correctValue(value, true);
384
387
  this.updateColumnValue(value).then(function () {
385
388
  picker.value = value;
386
389
  _this.$emit('input', value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/smart-ui",
3
- "version": "2.6.0-beta-3",
3
+ "version": "2.6.0-beta-4",
4
4
  "author": "MiniApp Team",
5
5
  "license": "MIT",
6
6
  "miniprogram": "lib",