react-date-picker
Advanced tools
Comparing version 8.0.6 to 8.0.7
@@ -86,3 +86,5 @@ "use strict"; | ||
var defaultMinDate = new Date('0001-01-01'); | ||
var defaultMinDate = new Date(); | ||
defaultMinDate.setFullYear(1, 0, 1); | ||
defaultMinDate.setHours(0, 0, 0, 0); | ||
var defaultMaxDate = new Date(8.64e15); | ||
@@ -92,2 +94,10 @@ var allViews = ['century', 'decade', 'year', 'month']; | ||
function toDate(value) { | ||
if (value instanceof Date) { | ||
return value; | ||
} | ||
return new Date(value); | ||
} | ||
function datesAreDifferent(date1, date2) { | ||
@@ -110,3 +120,3 @@ return date1 && !date2 || !date1 && date2 || date1 && date2 && date1.getTime() !== date2.getTime(); | ||
var rawValue = value instanceof Array && value.length === 2 ? value[index] : value; | ||
var rawValue = Array.isArray(value) && value.length === 2 ? value[index] : value; | ||
@@ -117,3 +127,3 @@ if (!rawValue) { | ||
var valueDate = new Date(rawValue); | ||
var valueDate = toDate(rawValue); | ||
@@ -154,3 +164,3 @@ if (isNaN(valueDate.getTime())) { | ||
if (value instanceof Array) { | ||
if (Array.isArray(value)) { | ||
return value; | ||
@@ -157,0 +167,0 @@ } |
{ | ||
"name": "react-date-picker", | ||
"version": "8.0.6", | ||
"version": "8.0.7", | ||
"description": "A date picker for your React app.", | ||
@@ -81,3 +81,3 @@ "main": "dist/entry.js", | ||
"prop-types": "^15.6.0", | ||
"react-calendar": "^3.0.0", | ||
"react-calendar": "^3.3.1", | ||
"react-fit": "^1.0.3", | ||
@@ -84,0 +84,0 @@ "update-input-width": "^1.1.1" |
@@ -20,3 +20,5 @@ import React, { PureComponent } from 'react'; | ||
const defaultMinDate = new Date('0001-01-01'); | ||
const defaultMinDate = new Date(); | ||
defaultMinDate.setFullYear(1, 0, 1); | ||
defaultMinDate.setHours(0, 0, 0, 0); | ||
const defaultMaxDate = new Date(8.64e15); | ||
@@ -26,2 +28,10 @@ const allViews = ['century', 'decade', 'year', 'month']; | ||
function toDate(value) { | ||
if (value instanceof Date) { | ||
return value; | ||
} | ||
return new Date(value); | ||
} | ||
function datesAreDifferent(date1, date2) { | ||
@@ -47,3 +57,3 @@ return ( | ||
const rawValue = value instanceof Array && value.length === 2 ? value[index] : value; | ||
const rawValue = Array.isArray(value) && value.length === 2 ? value[index] : value; | ||
@@ -54,3 +64,3 @@ if (!rawValue) { | ||
const valueDate = new Date(rawValue); | ||
const valueDate = toDate(rawValue); | ||
@@ -86,3 +96,3 @@ if (isNaN(valueDate.getTime())) { | ||
if (value instanceof Array) { | ||
if (Array.isArray(value)) { | ||
return value; | ||
@@ -89,0 +99,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
208738
5248
Updatedreact-calendar@^3.3.1