react-native-calendars-fei
Advanced tools
Comparing version 0.0.3 to 0.1.0
{ | ||
"name": "react-native-calendars-fei", | ||
"version": "0.0.3", | ||
"version": "0.1.0", | ||
"main": "src/index.js", | ||
@@ -5,0 +5,0 @@ "description": "React Native Calendar Components", |
@@ -111,3 +111,2 @@ import React, {Component} from 'react'; | ||
componentWillUpdate(nextProps, nextState) { | ||
const current= parseDate(this.props.current).clone(); | ||
const nextCurrentMonth= parseDate(nextState.currentMonth); | ||
@@ -117,2 +116,9 @@ const currentDateString = nextState.currentMonth[1].toString('yyyy MM') | ||
const minDate = parseDate(this.props.minDate); | ||
let current; | ||
if (this.props.current) { | ||
current= parseDate(this.props.current).clone(); | ||
} | ||
if (nextCurrentMonth !== this.state.currentMonth | ||
@@ -123,3 +129,4 @@ && currentDateString !== minDateString | ||
const currentSelectDay = nextState.currentMonth[1].clone().setDate(current.getDate()) | ||
let currentSelectDay = nextState.currentMonth[1].clone(); | ||
if (current) currentSelectDay = currentSelectDay.setDate(current.getDate()) | ||
@@ -129,3 +136,7 @@ while (currentSelectDay.getMonth() !== nextState.currentMonth[1].clone().getMonth()) { | ||
} | ||
this._handleDayInteraction(currentSelectDay, this.props.onDayPress); | ||
if (currentSelectDay < minDate){ | ||
this._handleDayInteraction(minDate, this.props.onDayPress) | ||
} else { | ||
this._handleDayInteraction(currentSelectDay, this.props.onDayPress) | ||
}; | ||
} | ||
@@ -216,3 +227,4 @@ } | ||
state = 'disabled'; | ||
} else if (dateutils.sameDate(day, XDate())) { | ||
} | ||
if (dateutils.sameDate(day, XDate())) { | ||
state = 'today'; | ||
@@ -219,0 +231,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Possible typosquat attack
Supply chain riskThere is a package with a similar name that is downloaded much more often.
Did you mean |
---|
react-native-calendars |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
115923
2739
0