react-native-calendars-fei
Advanced tools
Comparing version 0.1.5 to 0.2.0
{ | ||
"name": "react-native-calendars-fei", | ||
"version": "0.1.5", | ||
"version": "0.2.0", | ||
"main": "src/index.js", | ||
@@ -14,3 +14,3 @@ "description": "React Native Calendar Components", | ||
], | ||
"author": "AFei", | ||
"author": "Fei", | ||
"license": "MIT", | ||
@@ -17,0 +17,0 @@ "dependencies": { |
@@ -121,3 +121,3 @@ import React, {Component} from 'react'; | ||
const nextCurrentMonth= parseDate(nextState.currentMonth); | ||
const currentDateString = nextState.currentMonth[1].toString('yyyy MM'); | ||
const currentDateString = nextState.currentMonth[this.state.currentMonth.length < 3 ? 0 : 1].toString('yyyy MM'); | ||
const minDateString = this.state.currentMonth.length < 3 ? this.state.currentMonth[0].toString('yyyy MM') : this.state.currentMonth[1].toString('yyyy MM'); | ||
@@ -136,6 +136,6 @@ | ||
let currentSelectDay = nextState.currentMonth[1].clone(); | ||
let currentSelectDay = nextState.currentMonth.length < 3 ? nextState.currentMonth[0].clone() : nextState.currentMonth[1].clone(); | ||
if (current) currentSelectDay = currentSelectDay.setDate(current.getDate()); | ||
while (currentSelectDay.getMonth() !== nextState.currentMonth[1].clone().getMonth()) { | ||
while (currentSelectDay.getMonth() !== nextState.currentMonth[nextState.currentMonth.length < 3 ? 0 : 1].clone().getMonth()) { | ||
currentSelectDay.addDays(-1); | ||
@@ -146,3 +146,5 @@ } | ||
} else { | ||
this._handleDayInteraction(currentSelectDay, this.props.onDayPress); | ||
let lastSelectDay = this.state.currentMonth.length < 3 ? this.state.currentMonth[0].clone(): this.state.currentMonth[1].clone(); | ||
if (currentSelectDay !== lastSelectDay) | ||
this._handleDayInteraction(currentSelectDay, this.props.onDayPress); | ||
} | ||
@@ -149,0 +151,0 @@ } |
117068
2760