diff --git a/dist/datetime-picker/date-picker.js b/dist/datetime-picker/date-picker.js index eea6c23a..309ba6eb 100644 --- a/dist/datetime-picker/date-picker.js +++ b/dist/datetime-picker/date-picker.js @@ -37,7 +37,7 @@ module.exports = function () { date = date || this._date || new Date(); // toUTCString ISO 格式部分 ios 手机会失败 - if (typeof date === 'string' && date.indexOf('-') > 0) { + if (new Date(date).toString() === 'Invalid Date' && typeof date === 'string' && date.indexOf('-') > 0) { date = iso2utc(date); } diff --git a/dist/datetime-picker/index.js b/dist/datetime-picker/index.js index 55180ba6..44246df0 100644 --- a/dist/datetime-picker/index.js +++ b/dist/datetime-picker/index.js @@ -184,8 +184,13 @@ Component({ return +item[value[index]]; }); + var day = data.slice(0, 3); + var time = data.slice(3, 6); + var date = new Date(day.join('/') + ' ' + time.join(':')); + this.triggerEvent('change', { - value: data + value: data, + date: date }); // 手动触发 columnchange diff --git a/dist/toast/toast.js b/dist/toast/toast.js index 97596db0..934dbab0 100644 --- a/dist/toast/toast.js +++ b/dist/toast/toast.js @@ -1,6 +1,7 @@ 'use strict'; var TOAST_CONFIG_KEY = 'zanui.__zanToastPageConfig'; +var DEFAULT_SHOW_TOAST_TIME = 3000; var timeoutData = { timeoutId: 0, @@ -55,11 +56,13 @@ function Toast(optionsOrMsg, pageCtx) { })); var timeoutId = 0; - - if (parsedOptions.timeout >= 0) { + // toast 计时,如果小于0,就不会去关闭。 + // 如果不传,就取默认值 + var timeoutOption = parsedOptions.timeout || DEFAULT_SHOW_TOAST_TIME; + if (timeoutOption >= 0) { timeoutId = setTimeout(function () { toastCtx.clear(); - }, parsedOptions.timeout || 3000); + }, timeoutOption); } timeoutData = { @@ -78,7 +81,7 @@ Toast.setDefaultOptions = function () { type: options.type || '', icon: options.icon || '', image: options.image || '', - timeout: options.timeout || 3000 + timeout: options.timeout || DEFAULT_SHOW_TOAST_TIME }; if (type === 'global') {