Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-daypicker

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-daypicker - npm Package Compare versions

Comparing version 3.0.2 to 3.0.3

7

lib/DayPicker.js

@@ -84,3 +84,3 @@ "use strict";

var isToday = day && day.valueOf() === today.valueOf();
var isActive = active && day && active.valueOf() === day.valueOf();
var isActive = active && day && DayPicker.isSameDay(active, day);
return _react.default.createElement("td", {

@@ -205,2 +205,7 @@ className: ["day", isActive ? "active" : null, !day ? "empty" : null, isToday ? "today" : null].filter(function (v) {

}
}], [{
key: "isSameDay",
value: function isSameDay(a, b) {
return a && b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
}
}]);

@@ -207,0 +212,0 @@

2

package.json
{
"name": "react-daypicker",
"version": "3.0.2",
"version": "3.0.3",
"description": "A simple datepicker inspired by Pikaday.",

@@ -5,0 +5,0 @@ "main": "lib/DayPicker.js",

@@ -18,12 +18,4 @@ # react-daypicker

as a consumer that the `active` prop which was a `moment` date is **now expected to be a vanilla
JavaScript date**. However, for date equality reasons, `active` is expected to be a day so you
must pass in a `Date` instance with no more accuracy beyond date set.
JavaScript date**.
Example:
```javascript
<DayPicker active={new Date(2018, 11, 1)} />
```
([remember with JavaScript, months start at 0 so 11 is December](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMonth))
## Installation

@@ -66,3 +58,3 @@

<DayPicker
active={new Date(2018, 11, 1)}
active={new Date()}
onDayClick={(day) => this.setState({ day })}

@@ -69,0 +61,0 @@ />

@@ -17,3 +17,2 @@ import React, { Component } from "react";

];
const DAYS_LONG = [

@@ -28,3 +27,2 @@ "Sunday",

];
const DAYS_SHORT = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];

@@ -46,2 +44,12 @@

static isSameDay(a, b) {
return (
a &&
b &&
a.getFullYear() === b.getFullYear() &&
a.getMonth() === b.getMonth() &&
a.getDate() === b.getDate()
);
}
get days() {

@@ -124,3 +132,3 @@ const { month, year } = this.state;

const isToday = day && day.valueOf() === today.valueOf();
const isActive = active && day && active.valueOf() === day.valueOf();
const isActive = active && day && DayPicker.isSameDay(active, day);

@@ -127,0 +135,0 @@ return (

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc