react-daypicker
Advanced tools
Comparing version 3.0.4 to 3.0.5
@@ -72,3 +72,5 @@ "use strict"; | ||
return function () { | ||
_this.props.onDayClick(day); | ||
if (day) { | ||
_this.props.onDayClick(day); | ||
} | ||
}; | ||
@@ -176,3 +178,3 @@ }); | ||
year = _this$state6.year; | ||
var daysInMonth = new Date(year, month, 0).getDate(); | ||
var daysInMonth = new Date(year, month + 1, 0).getDate(); | ||
var days = []; | ||
@@ -187,3 +189,3 @@ var offset = new Date(year, month, 1).getDay(); | ||
for (var _i = 1; _i < daysInMonth; _i++) { | ||
for (var _i = 1; _i <= daysInMonth; _i++) { | ||
days.push(new Date(year, month, _i)); | ||
@@ -190,0 +192,0 @@ } |
{ | ||
"name": "react-daypicker", | ||
"version": "3.0.4", | ||
"version": "3.0.5", | ||
"description": "A simple datepicker inspired by Pikaday.", | ||
@@ -27,5 +27,3 @@ "main": "lib/DayPicker.js", | ||
"babel-plugin-transform-react-remove-prop-types": "0.4.21", | ||
"node-sass": "^4.11.0", | ||
"prop-types": "15.6.2", | ||
"react-moment-proptypes": "^1.6.0" | ||
"node-sass": "^4.11.0" | ||
}, | ||
@@ -32,0 +30,0 @@ "repository": { |
@@ -54,3 +54,3 @@ import React, { Component } from "react"; | ||
const { month, year } = this.state; | ||
const daysInMonth = new Date(year, month, 0).getDate(); | ||
const daysInMonth = new Date(year, month + 1, 0).getDate(); | ||
const days = []; | ||
@@ -63,3 +63,3 @@ const offset = new Date(year, month, 1).getDay(); | ||
} | ||
for (let i = 1; i < daysInMonth; i++) { | ||
for (let i = 1; i <= daysInMonth; i++) { | ||
days.push(new Date(year, month, i)); | ||
@@ -123,3 +123,5 @@ } | ||
onDayClick = day => () => { | ||
this.props.onDayClick(day); | ||
if (day) { | ||
this.props.onDayClick(day); | ||
} | ||
}; | ||
@@ -126,0 +128,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
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
8
400
65556