mini-antui
Advanced tools
Comparing version 0.0.15-alpha.1 to 0.0.15-alpha.2
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } | ||
/* eslint-disable complexity, no-param-reassign */ | ||
/* eslint max-depth: [2, 7] */ | ||
var leapYear = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; | ||
@@ -93,2 +95,6 @@ var commonYear = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; | ||
if (this.props.onMonthChange) { | ||
this.props.onMonthChange(month, selectedMonth); | ||
} | ||
this.setData({ | ||
@@ -116,2 +122,6 @@ selectedYear: year, | ||
if (this.props.onMonthChange) { | ||
this.props.onMonthChange(month, selectedMonth); | ||
} | ||
this.setData({ | ||
@@ -138,3 +148,3 @@ selectedYear: year, | ||
for (var i = 0; i < firstDay; i++) { | ||
num++; | ||
num += 1; | ||
// 如果当前选中的是一月份,前一个月是去年的12月 | ||
@@ -165,3 +175,3 @@ var _year = selectedYear; | ||
for (var _i = 0; _i < days; _i++) { | ||
num++; | ||
num += 1; | ||
var _date = _i + 1; | ||
@@ -261,3 +271,5 @@ var dateTimeStamp = +new Date(selectedYear, selectedMonth, _date); | ||
getDateGap: function getDateGap(day1, day2) { | ||
return (+new Date(day1.year, this.prefixNum(day1.month), this.prefixNum(day1.date)) - +new Date(day2.year, this.prefixNum(day2.month), this.prefixNum(day2.date))) / (24 * 3600 * 1000); | ||
var date1 = +new Date(day1.year, this.prefixNum(day1.month), this.prefixNum(day1.date)); | ||
var date2 = +new Date(day2.year, this.prefixNum(day2.month), this.prefixNum(day2.date)); | ||
return (date1 - date2) / (24 * 3600 * 1000); | ||
}, | ||
@@ -277,3 +289,3 @@ makeDate: function makeDate(dateObj) { | ||
if (type === 'range') { | ||
this.tapTimes++; | ||
this.tapTimes += 1; | ||
@@ -293,3 +305,2 @@ if (this.tapTimes % 2 === 0) { | ||
var dateObj = dates[i][j]; | ||
// dateObj.isSelected = false; | ||
dateObj.isStart = false; | ||
@@ -299,6 +310,6 @@ dateObj.isMiddle = false; | ||
if (this.getDateGap(dateObj, this.startDate) > 0 && this.getDateGap(dateObj, this.endDate) < 0) { | ||
if (dateGap === 0) { | ||
dateObj.isSelected = true; | ||
} else { | ||
var startDateGap = this.getDateGap(dateObj, this.startDate); | ||
var endDateGap = this.getDateGap(dateObj, this.endDate); | ||
if (startDateGap > 0 && endDateGap < 0) { | ||
if (dateGap !== 0) { | ||
if (j === 0) { | ||
@@ -311,2 +322,4 @@ dateObj.isStart = true; | ||
} | ||
} else { | ||
dateObj.isSelected = true; | ||
} | ||
@@ -313,0 +326,0 @@ } |
{ | ||
"name": "mini-antui", | ||
"version": "0.0.15-alpha.1", | ||
"version": "0.0.15-alpha.2", | ||
"description": "小程序版AntUI", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
94382
1456