zzc-design-mobile
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -204,3 +204,4 @@ 'use strict'; | ||
onValueChange = _props3.onValueChange, | ||
mode = _props3.mode; | ||
mode = _props3.mode, | ||
reverse = _props3.reverse; | ||
@@ -218,8 +219,9 @@ var currDateData = void 0; | ||
} | ||
// 上一次选择的月份的日期在当前选中的月份的日期没有的时候,选中最后一个日期 | ||
// 上一次选择的月份的日期在当前选中的月份的日期没有的时候,选中最后一个日期(通过参数确定是选中当前月份的第一日还是最后一日) | ||
var currYear = parseInt(currDateData[0]); | ||
var currMonth = parseInt(currDateData[1]); | ||
var currDay = parseInt(currDateData[2]); | ||
var currDateLastDay = (0, _date.getLastDate)(currYear, currMonth); | ||
if (currDay > currDateLastDay) { | ||
var currDateLastDay = reverse ? (0, _date.getFirstDate)(currYear, currMonth) : (0, _date.getLastDate)(currYear, currMonth); | ||
// 当只有反转模式下才会判断当前天数会不大于当前月份的最后一天 | ||
if (!reverse && currDay > currDateLastDay) { | ||
currDate = new Date(currDateData[0] + '/' + currDateData[1] + '/' + currDateLastDay); | ||
@@ -229,2 +231,3 @@ } else { | ||
} | ||
console.log(currDate); | ||
} else if (mode == 'time') { | ||
@@ -342,3 +345,4 @@ currDate = new Date('1993/09/17 ' + this.getCurrDate(scrollKey).currDate); | ||
visible: false, | ||
maskClose: true | ||
maskClose: true, | ||
reverse: false | ||
}; |
@@ -11,2 +11,3 @@ 'use strict'; | ||
exports.getLastDate = getLastDate; | ||
exports.getFirstDate = getFirstDate; | ||
@@ -129,2 +130,5 @@ var _typeof = require('../../_util/typeof'); | ||
return new Date(new Date(year + '/' + (0, _resetDate.resetDate)(month + 1) + '/01').setDate(0)).getDate(); | ||
} | ||
function getFirstDate(year, month) { | ||
return new Date(new Date(year + '/' + (0, _resetDate.resetDate)(month + 1) + '/01')).getDate(); | ||
} |
{ | ||
"name": "zzc-design-mobile", | ||
"name_cn": "租租车主流程UI规范", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "", | ||
@@ -6,0 +6,0 @@ "main": "./lib/index.js", |
427085
10826