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

react-calendar

Package Overview
Dependencies
Maintainers
3
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-calendar - npm Package Compare versions

Comparing version 3.6.0 to 3.7.0

17

dist/esm/Calendar.js

@@ -5,3 +5,3 @@ var _excluded = ["activeStartDate", "defaultActiveStartDate", "defaultValue", "defaultView", "maxDetail", "minDetail", "value", "view"];

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

@@ -12,5 +12,5 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }

@@ -29,5 +29,5 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -237,8 +237,5 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

_defineProperty(_assertThisInitialized(_this), "state", {
/* eslint-disable react/destructuring-assignment */
activeStartDate: _this.props.defaultActiveStartDate,
value: _this.props.defaultValue,
view: _this.props.defaultView
/* eslint-enable react/destructuring-assignment */
});

@@ -273,4 +270,4 @@

key in nextState && ( // …key changed from undefined to defined or the other way around, or…
_typeof(nextState[key]) !== _typeof(prevArgs[key]) // …value changed.
|| (nextState[key] instanceof Date ? nextState[key].getTime() !== prevArgs[key].getTime() : nextState[key] !== prevArgs[key]))
_typeof(nextState[key]) !== _typeof(prevArgs[key]) || ( // …value changed.
nextState[key] instanceof Date ? nextState[key].getTime() !== prevArgs[key].getTime() : nextState[key] !== prevArgs[key]))
);

@@ -277,0 +274,0 @@ }

@@ -130,3 +130,3 @@ import React from 'react';

className: "".concat(labelClassName, "__divider")
}, ' ', "\u2013", ' '), /*#__PURE__*/React.createElement("span", {
}, " \u2013 "), /*#__PURE__*/React.createElement("span", {
className: "".concat(labelClassName, "__labelText ").concat(labelClassName, "__labelText--to")

@@ -133,0 +133,0 @@ }, renderLabel(nextActiveStartDate))));

var _excluded = ["classes", "formatYear"];
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -7,0 +7,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -1,4 +0,4 @@

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -5,0 +5,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var _excluded = ["classes", "formatYear"];
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -7,0 +7,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -1,4 +0,4 @@

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -5,0 +5,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -5,5 +5,5 @@ var _excluded = ["children", "className", "direction", "count", "offset", "style", "wrap"];

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -10,0 +10,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var _excluded = ["formatDay", "formatLongDate", "calendarType", "classes", "currentMonthIndex"];
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -7,0 +7,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var _excluded = ["showFixedNumberOfWeeks", "showNeighboringMonth"];
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -7,0 +7,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -5,5 +5,5 @@ var _excluded = ["date", "onClickWeekNumber", "weekNumber"];

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -10,0 +10,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

import getUserLocale from 'get-user-locale';
var formatterCache = new Map();
function getFormatter(options) {
return function (locale, date) {
return date.toLocaleString(locale || getUserLocale(), options);
var localeWithDefault = locale || getUserLocale();
if (!formatterCache.has(localeWithDefault)) {
formatterCache.set(localeWithDefault, new Map());
}
var formatterCacheLocale = formatterCache.get(localeWithDefault);
if (!formatterCacheLocale.has(options)) {
formatterCacheLocale.set(options, new Intl.DateTimeFormat(localeWithDefault, options).format);
}
return formatterCacheLocale.get(options)(date);
};

@@ -7,0 +20,0 @@ }

@@ -1,2 +0,2 @@

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

@@ -48,3 +48,2 @@ import PropTypes from 'prop-types';

export var isRef = PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
// eslint-disable-next-line react/forbid-prop-types
current: PropTypes.any

@@ -51,0 +50,0 @@ })]);

@@ -1,6 +0,6 @@

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -11,5 +11,5 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }

@@ -35,2 +35,6 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function datesAreDifferent(date1, date2) {
return date1 && !date2 || !date1 && date2 || date1 && date2 && date1.getTime() !== date2.getTime();
}
function getValue(nextProps, prop) {

@@ -115,7 +119,8 @@ var activeStartDate = nextProps.activeStartDate,

value: function getDerivedStateFromProps(nextProps, prevState) {
var tileClassName = nextProps.tileClassName,
var activeStartDate = nextProps.activeStartDate,
tileClassName = nextProps.tileClassName,
tileContent = nextProps.tileContent;
var nextState = {};
if (tileClassName !== prevState.tileClassNameProps) {
if (tileClassName !== prevState.tileClassNameProps || datesAreDifferent(activeStartDate, prevState.activeStartDateProps)) {
nextState.tileClassName = getValue(nextProps, tileClassName);

@@ -125,3 +130,3 @@ nextState.tileClassNameProps = tileClassName;

if (tileContent !== prevState.tileContentProps) {
if (tileContent !== prevState.tileContentProps || datesAreDifferent(activeStartDate, prevState.activeStartDateProps)) {
nextState.tileContent = getValue(nextProps, tileContent);

@@ -131,2 +136,3 @@ nextState.tileContentProps = tileContent;

nextState.activeStartDateProps = activeStartDate;
return nextState;

@@ -133,0 +139,0 @@ }

var _excluded = ["className", "count", "dateTransform", "dateType", "end", "hover", "offset", "start", "step", "tile", "value", "valueType"];
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -7,0 +7,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var _excluded = ["classes", "formatMonth", "formatMonthYear"];
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -7,0 +7,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -1,4 +0,4 @@

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -5,0 +5,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

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

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

@@ -47,5 +47,5 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }

@@ -64,5 +64,5 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -261,8 +261,5 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

_defineProperty(_assertThisInitialized(_this), "state", {
/* eslint-disable react/destructuring-assignment */
activeStartDate: _this.props.defaultActiveStartDate,
value: _this.props.defaultValue,
view: _this.props.defaultView
/* eslint-enable react/destructuring-assignment */
});

@@ -297,4 +294,4 @@

key in nextState && ( // …key changed from undefined to defined or the other way around, or…
_typeof(nextState[key]) !== _typeof(prevArgs[key]) // …value changed.
|| (nextState[key] instanceof Date ? nextState[key].getTime() !== prevArgs[key].getTime() : nextState[key] !== prevArgs[key]))
_typeof(nextState[key]) !== _typeof(prevArgs[key]) || ( // …value changed.
nextState[key] instanceof Date ? nextState[key].getTime() !== prevArgs[key].getTime() : nextState[key] !== prevArgs[key]))
);

@@ -301,0 +298,0 @@ }

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

className: "".concat(labelClassName, "__divider")
}, ' ', "\u2013", ' '), /*#__PURE__*/_react["default"].createElement("span", {
}, " \u2013 "), /*#__PURE__*/_react["default"].createElement("span", {
className: "".concat(labelClassName, "__labelText ").concat(labelClassName, "__labelText--to")

@@ -149,0 +149,0 @@ }, renderLabel(nextActiveStartDate))));

@@ -26,5 +26,5 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -31,0 +31,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -22,5 +22,5 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -27,0 +27,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -24,5 +24,5 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -29,0 +29,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -20,5 +20,5 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -25,0 +25,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -18,5 +18,5 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -23,0 +23,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -24,12 +24,12 @@ "use strict";

});
Object.defineProperty(exports, "YearView", {
Object.defineProperty(exports, "MonthView", {
enumerable: true,
get: function get() {
return _YearView["default"];
return _MonthView["default"];
}
});
Object.defineProperty(exports, "MonthView", {
Object.defineProperty(exports, "YearView", {
enumerable: true,
get: function get() {
return _MonthView["default"];
return _YearView["default"];
}

@@ -36,0 +36,0 @@ });

@@ -26,5 +26,5 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -31,0 +31,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -26,5 +26,5 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -31,0 +31,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -18,5 +18,5 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -23,0 +23,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -12,5 +12,19 @@ "use strict";

var formatterCache = new Map();
function getFormatter(options) {
return function (locale, date) {
return date.toLocaleString(locale || (0, _getUserLocale["default"])(), options);
var localeWithDefault = locale || (0, _getUserLocale["default"])();
if (!formatterCache.has(localeWithDefault)) {
formatterCache.set(localeWithDefault, new Map());
}
var formatterCacheLocale = formatterCache.get(localeWithDefault);
if (!formatterCacheLocale.has(options)) {
formatterCacheLocale.set(options, new Intl.DateTimeFormat(localeWithDefault, options).format);
}
return formatterCacheLocale.get(options)(date);
};

@@ -17,0 +31,0 @@ }

@@ -6,18 +6,20 @@ "use strict";

});
exports.getDayOfWeek = getDayOfWeek;
exports.getBegin = getBegin;
exports.getBeginNext = getBeginNext;
exports.getBeginNext2 = void 0;
exports.getBeginOfCenturyYear = getBeginOfCenturyYear;
exports.getBeginOfDecadeYear = getBeginOfDecadeYear;
exports.getBeginOfWeek = getBeginOfWeek;
exports.getWeekNumber = getWeekNumber;
exports.getBegin = getBegin;
exports.getBeginPrevious = getBeginPrevious;
exports.getBeginNext = getBeginNext;
exports.getBeginPrevious2 = void 0;
exports.getCenturyLabel = getCenturyLabel;
exports.getDayOfWeek = getDayOfWeek;
exports.getDecadeLabel = getDecadeLabel;
exports.getEnd = getEnd;
exports.getEndPrevious = getEndPrevious;
exports.getEndPrevious2 = void 0;
exports.getRange = getRange;
exports.getValueRange = getValueRange;
exports.getCenturyLabel = getCenturyLabel;
exports.getDecadeLabel = getDecadeLabel;
exports.getWeekNumber = getWeekNumber;
exports.isWeekend = isWeekend;
exports.getEndPrevious2 = exports.getBeginNext2 = exports.getBeginPrevious2 = void 0;

@@ -24,0 +26,0 @@ var _dateUtils = require("@wojtekmaj/date-utils");

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

});
exports.tileProps = exports.tileGroupProps = exports.isView = exports.isViews = exports.isValue = exports.isRef = exports.isMaxDate = exports.isMinDate = exports.isClassName = exports.isCalendarType = void 0;
exports.tileProps = exports.tileGroupProps = exports.isViews = exports.isView = exports.isValue = exports.isRef = exports.isMinDate = exports.isMaxDate = exports.isClassName = exports.isCalendarType = void 0;

@@ -15,3 +15,3 @@ var _propTypes = _interopRequireDefault(require("prop-types"));

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

@@ -74,3 +74,2 @@ var calendarTypes = Object.values(_const.CALENDAR_TYPES);

var isRef = _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].shape({
// eslint-disable-next-line react/forbid-prop-types
current: _propTypes["default"].any

@@ -77,0 +76,0 @@ })]);

@@ -7,6 +7,6 @@ "use strict";

exports.between = between;
exports.isValueWithinRange = isValueWithinRange;
exports.isRangeWithinRange = isRangeWithinRange;
exports.doRangesOverlap = doRangesOverlap;
exports.getTileClasses = getTileClasses;
exports.isRangeWithinRange = isRangeWithinRange;
exports.isValueWithinRange = isValueWithinRange;

@@ -13,0 +13,0 @@ var _dates = require("./dates");

"use strict";
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

@@ -24,5 +24,5 @@ Object.defineProperty(exports, "__esModule", {

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -33,5 +33,5 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }

@@ -52,2 +52,6 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function datesAreDifferent(date1, date2) {
return date1 && !date2 || !date1 && date2 || date1 && date2 && date1.getTime() !== date2.getTime();
}
function getValue(nextProps, prop) {

@@ -132,7 +136,8 @@ var activeStartDate = nextProps.activeStartDate,

value: function getDerivedStateFromProps(nextProps, prevState) {
var tileClassName = nextProps.tileClassName,
var activeStartDate = nextProps.activeStartDate,
tileClassName = nextProps.tileClassName,
tileContent = nextProps.tileContent;
var nextState = {};
if (tileClassName !== prevState.tileClassNameProps) {
if (tileClassName !== prevState.tileClassNameProps || datesAreDifferent(activeStartDate, prevState.activeStartDateProps)) {
nextState.tileClassName = getValue(nextProps, tileClassName);

@@ -142,3 +147,3 @@ nextState.tileClassNameProps = tileClassName;

if (tileContent !== prevState.tileContentProps) {
if (tileContent !== prevState.tileContentProps || datesAreDifferent(activeStartDate, prevState.activeStartDateProps)) {
nextState.tileContent = getValue(nextProps, tileContent);

@@ -148,2 +153,3 @@ nextState.tileContentProps = tileContent;

nextState.activeStartDateProps = activeStartDate;
return nextState;

@@ -150,0 +156,0 @@ }

@@ -22,5 +22,5 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -27,0 +27,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -24,5 +24,5 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -29,0 +29,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -22,5 +22,5 @@ "use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -27,0 +27,0 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

{
"name": "react-calendar",
"version": "3.6.0",
"version": "3.7.0",
"description": "Ultimate calendar for your React app.",

@@ -80,8 +80,10 @@ "main": "dist/umd/index.js",

"@wojtekmaj/enzyme-adapter-react-17": "^0.6.0",
"babel-eslint": "^10.0.0",
"enzyme": "^3.10.0",
"eslint": "~7.19.0",
"eslint-config-wojtekmaj": "^0.5.0",
"eslint": "^8.5.0",
"eslint-config-wojtekmaj": "^0.6.5",
"husky": "^7.0.0",
"jest": "^27.0.0",
"less": "^4.0.0",
"prettier": "^2.5.0",
"pretty-quick": "^3.1.0",
"react": "^17.0.0",

@@ -92,4 +94,4 @@ "react-dom": "^17.0.0",

"peerDependencies": {
"react": "^16.3.0 || ^17.0.0-0",
"react-dom": "^16.3.0 || ^17.0.0-0"
"react": "^16.3.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.3.0 || ^17.0.0 || ^18.0.0"
},

@@ -100,6 +102,4 @@ "resolutions": {

"files": [
"LICENSE",
"README.md",
"dist/",
"src/"
"dist",
"src"
],

@@ -106,0 +106,0 @@ "repository": {

@@ -11,12 +11,13 @@ [![npm](https://img.shields.io/npm/v/react-calendar.svg)](https://www.npmjs.com/package/react-calendar) ![downloads](https://img.shields.io/npm/dt/react-calendar.svg) [![CI](https://github.com/wojtekmaj/react-calendar/workflows/CI/badge.svg)](https://github.com/wojtekmaj/react-calendar/actions) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest)

* Pick days, months, years, or even decades
* Supports range selection
* Supports virtually any language
* No moment.js needed
- Pick days, months, years, or even decades
- Supports range selection
- Supports virtually any language
- No moment.js needed
## tl;dr
* Install by executing `npm install react-calendar` or `yarn add react-calendar`.
* Import by adding `import Calendar from 'react-calendar'`.
* Use by adding `<Calendar />`. Use `onChange` prop for getting new values.
- Install by executing `npm install react-calendar` or `yarn add react-calendar`.
- Import by adding `import Calendar from 'react-calendar'`.
- Use by adding `<Calendar />`. Use `onChange` prop for getting new values.
## Demo

@@ -32,3 +33,3 @@

* [v2.x](https://github.com/wojtekmaj/react-calendar/blob/v2.x/README.md)
- [v2.x](https://github.com/wojtekmaj/react-calendar/blob/v2.x/README.md)

@@ -64,6 +65,3 @@ ## Getting started

<div>
<Calendar
onChange={onChange}
value={value}
/>
<Calendar onChange={onChange} value={value} />
</div>

@@ -92,56 +90,56 @@ );

|Prop name|Description|Default value|Example values|
|----|----|----|----|
|activeStartDate|The beginning of a period that shall be displayed. If you wish to use React-Calendar in an uncontrolled way, use `defaultActiveStartDate` instead.|(today)|`new Date(2017, 0, 1)`|
|allowPartialRange|Whether to call onChange with only partial result given `selectRange` prop.|`false`|`true`|
|calendarType|Type of calendar that should be used. Can be `"ISO 8601"`, `"US"`, `"Arabic"`, or `"Hebrew"`. Setting to `"US"` or `"Hebrew"` will change the first day of the week to Sunday. Setting to `"Arabic"` will change the first day of the week to Saturday. Setting to `"Arabic"` or `"Hebrew"` will make weekends appear on Friday to Saturday.|Type of calendar most commonly used in a given locale|`"ISO 8601"`|
|className|Class name(s) that will be added along with `"react-calendar"` to the main React-Calendar `<div>` element.|n/a|<ul><li>String: `"class1 class2"`</li><li>Array of strings: `["class1", "class2 class3"]`</li></ul>|
|defaultActiveStartDate|The beginning of a period that shall be displayed by default. If you wish to use React-Calendar in a controlled way, use `activeStartDate` instead.|(today)|`new Date(2017, 0, 1)`|
|defaultValue|Calendar value that shall be selected initially. Can be either one value or an array of two values. If you wish to use React-Calendar in a controlled way, use `value` instead.|n/a|<ul><li>Date: `new Date()`</li><li>An array of dates: `[new Date(2017, 0, 1), new Date(2017, 7, 1)]`|
|defaultView|Determines which calendar view shall be opened initially. Does not disable navigation. Can be `"month"`, `"year"`, `"decade"` or `"century"`. If you wish to use React-Calendar in a controlled way, use `view` instead.|The most detailed view allowed|`"year"`|
|formatDay|Function called to override default formatting of day tile labels. Can be used to use your own formatting function.|(default formatter)|`(locale, date) => formatDate(date, 'd')`|
|formatLongDate|Function called to override default formatting of day tile `abbr` labels. Can be used to use your own formatting function.|(default formatter)|`(locale, date) => formatDate(date, 'dd MMM YYYY')`|
|formatMonth|Function called to override default formatting of month names. Can be used to use your own formatting function.|(default formatter)|`(locale, date) => formatDate(date, 'MMM')`|
|formatMonthYear|Function called to override default formatting of months and years. Can be used to use your own formatting function.|(default formatter)|`(locale, date) => formatDate(date, 'MMMM YYYY')`|
|formatShortWeekday|Function called to override default formatting of weekday names. Can be used to use your own formatting function.|(default formatter)|`(locale, date) => formatDate(date, 'dd')`|
|formatYear|Function called to override default formatting of year in the top navigation section. Can be used to use your own formatting function.|(default formatter)|`(locale, date) => formatDate(date, 'YYYY')`|
|inputRef|A prop that behaves like [ref](https://reactjs.org/docs/refs-and-the-dom.html), but it's passed to main `<div>` rendered by `<Calendar>` component.|n/a|<ul><li>Function:<br />`(ref) => { this.myCalendar = ref; }`</li><li>Ref created using `React.createRef`:<br />`this.ref = React.createRef();`<br />…<br />`inputRef={this.ref}`</li><li>Ref created using `React.useRef`:<br />`const ref = React.useRef();`<br />…<br />`inputRef={ref}`</li></ul>|
|locale|Locale that should be used by the calendar. Can be any [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag).|User's browser settings|`"hu-HU"`|
|maxDate|Maximum date that the user can select. Periods partially overlapped by maxDate will also be selectable, although React-Calendar will ensure that no later date is selected.|n/a|Date: `new Date()`|
|maxDetail|The most detailed view that the user shall see. View defined here also becomes the one on which clicking an item will select a date and pass it to onChange. Can be `"month"`, `"year"`, `"decade"` or `"century"`.|`"month"`|`"year"`|
|minDate|Minimum date that the user can select. Periods partially overlapped by minDate will also be selectable, although React-Calendar will ensure that no earlier date is selected.|n/a|Date: `new Date()`|
|minDetail|The least detailed view that the user shall see. Can be `"month"`, `"year"`, `"decade"` or `"century"`.|`"century"`|`"decade"`|
|navigationAriaLabel|`aria-label` attribute of a label rendered on calendar navigation bar.|n/a|`"Go up"`|
|navigationAriaLive|`aria-live` attribute of a label rendered on calendar navigation bar.|`undefined`|`"polite"`|
|navigationLabel|Content of a label rendered on calendar navigation bar.|(default label)|``({ date, label, locale, view }) => `Current view: ${view}, date: ${date.toLocaleDateString(locale)}` ``|
|nextAriaLabel|`aria-label` attribute of the "next" button on the navigation pane.|n/a|`"Next"`|
|nextLabel|Content of the "next" button on the navigation pane. Setting the value explicitly to null will hide the icon.|`"›"`|<ul><li>String: `"›"`</li><li>React element: `<NextIcon />`</li></ul>|
|next2AriaLabel|`aria-label` attribute of the "next on higher level" button on the navigation pane.|n/a|`"Jump forwards"`|
|next2Label|Content of the "next on higher level" button on the navigation pane. Setting the value explicitly to null will hide the icon.|`"»"`|<ul><li>String: `"»"`</li><li>React element: `<DoubleNextIcon />`</li></ul>|
|onActiveStartDateChange|Function called when the user navigates from one view to another using previous/next button. Note that this function will not be called when e.g. drilling up from January 2021 to 2021 or drilling down the other way around.<br />`action` signifies the reason for active start date change and can be one of the following values: `"prev"`, `"prev2"`, `"next"`, `"next2"`, `"drillUp"`, `"drillDown"`, `"onChange"`.|n/a|`({ action, activeStartDate, value, view }) => alert('Changed view to: ', activeStartDate, view)`|
|onChange|Function called when the user clicks an item (day on month view, month on year view and so on) on the most detailed view available.|n/a|`(value, event) => alert('New date is: ', value)`|
|onViewChange|Function called when the user navigates from one view to another using drill up button or by clicking a tile.<br />`action` signifies the reason for view change and can be one of the following values: `"prev"`, `"prev2"`, `"next"`, `"next2"`, `"drillUp"`, `"drillDown"`, `"onChange"`.|n/a|`({ action, activeStartDate, value, view }) => alert('New view is: ', view)`|
|onClickDay|Function called when the user clicks a day.|n/a|`(value, event) => alert('Clicked day: ', value)`|
|onClickDecade|Function called when the user clicks a decade.|n/a|`(value, event) => alert('Clicked decade: ', value)`|
|onClickMonth|Function called when the user clicks a month.|n/a|`(value, event) => alert('Clicked month: ', value)`|
|onClickWeekNumber|Function called when the user clicks a week number.|n/a|`(weekNumber, date, event) => alert('Clicked week: ', weekNumber, 'that starts on: ', date)`|
|onClickYear|Function called when the user clicks a year.|n/a|`(value, event) => alert('Clicked year: ', value)`|
|onDrillDown|Function called when the user drills down by clicking a tile.|n/a|`({ activeStartDate, view }) => alert('Drilled down to: ', activeStartDate, view)`|
|onDrillUp|Function called when the user drills up by clicking drill up button.|n/a|`({ activeStartDate, view }) => alert('Drilled up to: ', activeStartDate, view)`|
|prevAriaLabel|`aria-label` attribute of the "previous" button on the navigation pane.|n/a|`"Previous"`|
|prevLabel|Content of the "previous" button on the navigation pane. Setting the value explicitly to null will hide the icon.|`"‹"`|<ul><li>String: `"‹"`</li><li>React element: `<PreviousIcon />`</li></ul>|
|prev2AriaLabel|`aria-label` attribute of the "previous on higher level" button on the navigation pane.|n/a|`"Jump backwards"`|
|prev2Label|Content of the "previous on higher level" button on the navigation pane. Setting the value explicitly to null will hide the icon.|`"«"`|<ul><li>String: `"«"`</li><li>React element: `<DoublePreviousIcon />`</li></ul>|
|returnValue|Which dates shall be passed by the calendar to the onChange function and onClick{Period} functions. Can be `"start"`, `"end"` or `"range"`. The latter will cause an array with start and end values to be passed.|`"start"`|`"range"`|
|showDoubleView|Whether to show two months/years/… at a time instead of one. Defaults `showFixedNumberOfWeeks` prop to be `true`.|`false`|`true`|
|showFixedNumberOfWeeks|Whether to always show fixed number of weeks (6). Forces `showNeighboringMonth` prop to be `true`.|`false`|`true`|
|showNavigation|Whether a navigation bar with arrows and title shall be rendered.|`true`|`false`|
|showNeighboringMonth|Whether days from previous or next month shall be rendered if the month doesn't start on the first day of the week or doesn't end on the last day of the week, respectively.|`true`|`false`|
|selectRange|Whether the user shall select two dates forming a range instead of just one. Note: This feature will make React-Calendar return array with two dates regardless of returnValue setting.|`false`|`true`|
|showWeekNumbers|Whether week numbers shall be shown at the left of MonthView or not.|`false`|`true`|
|tileClassName|Class name(s) that will be applied to a given calendar item (day on month view, month on year view and so on).|n/a|<ul><li>String: `"class1 class2"`</li><li>Array of strings: `["class1", "class2 class3"]`</li><li>Function: `({ activeStartDate, date, view }) => view === 'month' && date.getDay() === 3 ? 'wednesday' : null`</li></ul>|
|tileContent|Allows to render custom content within a given calendar item (day on month view, month on year view and so on).|n/a|<ul><li>String: `"Sample"`</li><li>React element: `<TileContent />`</li><li>Function: `({ activeStartDate, date, view }) => view === 'month' && date.getDay() === 0 ? <p>It's Sunday!</p> : null`</li></ul>|
|tileDisabled|Pass a function to determine if a certain day should be displayed as disabled.|n/a|<ul><li>Function: `({activeStartDate, date, view }) => date.getDay() === 0`</li></ul>|
|value|Calendar value. Can be either one value or an array of two values. If you wish to use React-Calendar in an uncontrolled way, use `defaultValue` instead.|n/a|<ul><li>Date: `new Date()`</li><li>An array of dates: `[new Date(2017, 0, 1), new Date(2017, 7, 1)]`|
|view|Determines which calendar view shall be opened. Does not disable navigation. Can be `"month"`, `"year"`, `"decade"` or `"century"`. If you wish to use React-Calendar in an uncontrolled way, use `defaultView` instead.|The most detailed view allowed|`"year"`|
| Prop name | Description | Default value | Example values |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| activeStartDate | The beginning of a period that shall be displayed. If you wish to use React-Calendar in an uncontrolled way, use `defaultActiveStartDate` instead. | (today) | `new Date(2017, 0, 1)` |
| allowPartialRange | Whether to call onChange with only partial result given `selectRange` prop. | `false` | `true` |
| calendarType | Type of calendar that should be used. Can be `"ISO 8601"`, `"US"`, `"Arabic"`, or `"Hebrew"`. Setting to `"US"` or `"Hebrew"` will change the first day of the week to Sunday. Setting to `"Arabic"` will change the first day of the week to Saturday. Setting to `"Arabic"` or `"Hebrew"` will make weekends appear on Friday to Saturday. | Type of calendar most commonly used in a given locale | `"ISO 8601"` |
| className | Class name(s) that will be added along with `"react-calendar"` to the main React-Calendar `<div>` element. | n/a | <ul><li>String: `"class1 class2"`</li><li>Array of strings: `["class1", "class2 class3"]`</li></ul> |
| defaultActiveStartDate | The beginning of a period that shall be displayed by default. If you wish to use React-Calendar in a controlled way, use `activeStartDate` instead. | (today) | `new Date(2017, 0, 1)` |
| defaultValue | Calendar value that shall be selected initially. Can be either one value or an array of two values. If you wish to use React-Calendar in a controlled way, use `value` instead. | n/a | <ul><li>Date: `new Date()`</li><li>An array of dates: `[new Date(2017, 0, 1), new Date(2017, 7, 1)]` |
| defaultView | Determines which calendar view shall be opened initially. Does not disable navigation. Can be `"month"`, `"year"`, `"decade"` or `"century"`. If you wish to use React-Calendar in a controlled way, use `view` instead. | The most detailed view allowed | `"year"` |
| formatDay | Function called to override default formatting of day tile labels. Can be used to use your own formatting function. | (default formatter) | `(locale, date) => formatDate(date, 'd')` |
| formatLongDate | Function called to override default formatting of day tile `abbr` labels. Can be used to use your own formatting function. | (default formatter) | `(locale, date) => formatDate(date, 'dd MMM YYYY')` |
| formatMonth | Function called to override default formatting of month names. Can be used to use your own formatting function. | (default formatter) | `(locale, date) => formatDate(date, 'MMM')` |
| formatMonthYear | Function called to override default formatting of months and years. Can be used to use your own formatting function. | (default formatter) | `(locale, date) => formatDate(date, 'MMMM YYYY')` |
| formatShortWeekday | Function called to override default formatting of weekday names. Can be used to use your own formatting function. | (default formatter) | `(locale, date) => formatDate(date, 'dd')` |
| formatYear | Function called to override default formatting of year in the top navigation section. Can be used to use your own formatting function. | (default formatter) | `(locale, date) => formatDate(date, 'YYYY')` |
| inputRef | A prop that behaves like [ref](https://reactjs.org/docs/refs-and-the-dom.html), but it's passed to main `<div>` rendered by `<Calendar>` component. | n/a | <ul><li>Function:<br />`(ref) => { this.myCalendar = ref; }`</li><li>Ref created using `React.createRef`:<br />`this.ref = React.createRef();`<br />…<br />`inputRef={this.ref}`</li><li>Ref created using `React.useRef`:<br />`const ref = React.useRef();`<br />…<br />`inputRef={ref}`</li></ul> |
| locale | Locale that should be used by the calendar. Can be any [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag). | User's browser settings | `"hu-HU"` |
| maxDate | Maximum date that the user can select. Periods partially overlapped by maxDate will also be selectable, although React-Calendar will ensure that no later date is selected. | n/a | Date: `new Date()` |
| maxDetail | The most detailed view that the user shall see. View defined here also becomes the one on which clicking an item will select a date and pass it to onChange. Can be `"month"`, `"year"`, `"decade"` or `"century"`. | `"month"` | `"year"` |
| minDate | Minimum date that the user can select. Periods partially overlapped by minDate will also be selectable, although React-Calendar will ensure that no earlier date is selected. | n/a | Date: `new Date()` |
| minDetail | The least detailed view that the user shall see. Can be `"month"`, `"year"`, `"decade"` or `"century"`. | `"century"` | `"decade"` |
| navigationAriaLabel | `aria-label` attribute of a label rendered on calendar navigation bar. | n/a | `"Go up"` |
| navigationAriaLive | `aria-live` attribute of a label rendered on calendar navigation bar. | `undefined` | `"polite"` |
| navigationLabel | Content of a label rendered on calendar navigation bar. | (default label) | `` ({ date, label, locale, view }) => `Current view: ${view}, date: ${date.toLocaleDateString(locale)}` `` |
| nextAriaLabel | `aria-label` attribute of the "next" button on the navigation pane. | n/a | `"Next"` |
| nextLabel | Content of the "next" button on the navigation pane. Setting the value explicitly to null will hide the icon. | `"›"` | <ul><li>String: `"›"`</li><li>React element: `<NextIcon />`</li></ul> |
| next2AriaLabel | `aria-label` attribute of the "next on higher level" button on the navigation pane. | n/a | `"Jump forwards"` |
| next2Label | Content of the "next on higher level" button on the navigation pane. Setting the value explicitly to null will hide the icon. | `"»"` | <ul><li>String: `"»"`</li><li>React element: `<DoubleNextIcon />`</li></ul> |
| onActiveStartDateChange | Function called when the user navigates from one view to another using previous/next button. Note that this function will not be called when e.g. drilling up from January 2021 to 2021 or drilling down the other way around.<br />`action` signifies the reason for active start date change and can be one of the following values: `"prev"`, `"prev2"`, `"next"`, `"next2"`, `"drillUp"`, `"drillDown"`, `"onChange"`. | n/a | `({ action, activeStartDate, value, view }) => alert('Changed view to: ', activeStartDate, view)` |
| onChange | Function called when the user clicks an item (day on month view, month on year view and so on) on the most detailed view available. | n/a | `(value, event) => alert('New date is: ', value)` |
| onViewChange | Function called when the user navigates from one view to another using drill up button or by clicking a tile.<br />`action` signifies the reason for view change and can be one of the following values: `"prev"`, `"prev2"`, `"next"`, `"next2"`, `"drillUp"`, `"drillDown"`, `"onChange"`. | n/a | `({ action, activeStartDate, value, view }) => alert('New view is: ', view)` |
| onClickDay | Function called when the user clicks a day. | n/a | `(value, event) => alert('Clicked day: ', value)` |
| onClickDecade | Function called when the user clicks a decade. | n/a | `(value, event) => alert('Clicked decade: ', value)` |
| onClickMonth | Function called when the user clicks a month. | n/a | `(value, event) => alert('Clicked month: ', value)` |
| onClickWeekNumber | Function called when the user clicks a week number. | n/a | `(weekNumber, date, event) => alert('Clicked week: ', weekNumber, 'that starts on: ', date)` |
| onClickYear | Function called when the user clicks a year. | n/a | `(value, event) => alert('Clicked year: ', value)` |
| onDrillDown | Function called when the user drills down by clicking a tile. | n/a | `({ activeStartDate, view }) => alert('Drilled down to: ', activeStartDate, view)` |
| onDrillUp | Function called when the user drills up by clicking drill up button. | n/a | `({ activeStartDate, view }) => alert('Drilled up to: ', activeStartDate, view)` |
| prevAriaLabel | `aria-label` attribute of the "previous" button on the navigation pane. | n/a | `"Previous"` |
| prevLabel | Content of the "previous" button on the navigation pane. Setting the value explicitly to null will hide the icon. | `"‹"` | <ul><li>String: `"‹"`</li><li>React element: `<PreviousIcon />`</li></ul> |
| prev2AriaLabel | `aria-label` attribute of the "previous on higher level" button on the navigation pane. | n/a | `"Jump backwards"` |
| prev2Label | Content of the "previous on higher level" button on the navigation pane. Setting the value explicitly to null will hide the icon. | `"«"` | <ul><li>String: `"«"`</li><li>React element: `<DoublePreviousIcon />`</li></ul> |
| returnValue | Which dates shall be passed by the calendar to the onChange function and onClick{Period} functions. Can be `"start"`, `"end"` or `"range"`. The latter will cause an array with start and end values to be passed. | `"start"` | `"range"` |
| showDoubleView | Whether to show two months/years/… at a time instead of one. Defaults `showFixedNumberOfWeeks` prop to be `true`. | `false` | `true` |
| showFixedNumberOfWeeks | Whether to always show fixed number of weeks (6). Forces `showNeighboringMonth` prop to be `true`. | `false` | `true` |
| showNavigation | Whether a navigation bar with arrows and title shall be rendered. | `true` | `false` |
| showNeighboringMonth | Whether days from previous or next month shall be rendered if the month doesn't start on the first day of the week or doesn't end on the last day of the week, respectively. | `true` | `false` |
| selectRange | Whether the user shall select two dates forming a range instead of just one. Note: This feature will make React-Calendar return array with two dates regardless of returnValue setting. | `false` | `true` |
| showWeekNumbers | Whether week numbers shall be shown at the left of MonthView or not. | `false` | `true` |
| tileClassName | Class name(s) that will be applied to a given calendar item (day on month view, month on year view and so on). | n/a | <ul><li>String: `"class1 class2"`</li><li>Array of strings: `["class1", "class2 class3"]`</li><li>Function: `({ activeStartDate, date, view }) => view === 'month' && date.getDay() === 3 ? 'wednesday' : null`</li></ul> |
| tileContent | Allows to render custom content within a given calendar item (day on month view, month on year view and so on). | n/a | <ul><li>String: `"Sample"`</li><li>React element: `<TileContent />`</li><li>Function: `({ activeStartDate, date, view }) => view === 'month' && date.getDay() === 0 ? <p>It's Sunday!</p> : null`</li></ul> |
| tileDisabled | Pass a function to determine if a certain day should be displayed as disabled. | n/a | <ul><li>Function: `({activeStartDate, date, view }) => date.getDay() === 0`</li></ul> |
| value | Calendar value. Can be either one value or an array of two values. If you wish to use React-Calendar in an uncontrolled way, use `defaultValue` instead. | n/a | <ul><li>Date: `new Date()`</li><li>An array of dates: `[new Date(2017, 0, 1), new Date(2017, 7, 1)]` |
| view | Determines which calendar view shall be opened. Does not disable navigation. Can be `"month"`, `"year"`, `"decade"` or `"century"`. If you wish to use React-Calendar in an uncontrolled way, use `defaultView` instead. | The most detailed view allowed | `"year"` |

@@ -154,16 +152,16 @@ ### MonthView, YearView, DecadeView, CenturyView

|Prop name|Description|Default value|Example values|
|----|----|----|----|
|activeStartDate|The beginning of a period that shall be displayed.|n/a|`new Date(2017, 0, 1)`|
|hover|The date over which the user is hovering. Used only when `selectRange` is enabled, to render a “WIP” range when the user is selecting range.|n/a|`new Date(2017, 0, 1)`|
|maxDate|Maximum date that the user can select. Periods partially overlapped by maxDate will also be selectable, although react-calendar will ensure that no later date is selected.|n/a|Date: `new Date()`|
|minDate|Minimum date that the user can select. Periods partially overlapped by minDate will also be selectable, although react-calendar will ensure that no earlier date is selected.|n/a|Date: `new Date()`|
|onClick|Function called when the user clicks an item (day on month view, month on year view and so on).|n/a|`(value) => alert('New date is: ', value)`|
|tileClassName|Class name(s) that will be applied to a given calendar item (day on month view, month on year view and so on).|n/a|<ul><li>String: `"class1 class2"`</li><li>Array of strings: `["class1", "class2 class3"]`</li><li>Function: `({ date, view }) => view === 'month' && date.getDay() === 3 ? 'saturday' : null`</li></ul>|
|tileContent|Allows to render custom content within a given item (day on month view, month on year view and so on). Note: For tiles with custom content you might want to set fixed height of `react-calendar__tile` to ensure consistent layout.|n/a|`({ date, view }) => view === 'month' && date.getDay() === 0 ? <p>It's Sunday!</p> : null`|
|value|Calendar value. Can be either one value or an array of two values.|n/a|<ul><li>Date: `new Date()`</li><li>An array of dates: `[new Date(2017, 0, 1), new Date(2017, 7, 1)]`</li><li>String: `2017-01-01`</li><li>An array of strings: `['2017-01-01', '2017-08-01']`</li></ul>|
| Prop name | Description | Default value | Example values |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| activeStartDate | The beginning of a period that shall be displayed. | n/a | `new Date(2017, 0, 1)` |
| hover | The date over which the user is hovering. Used only when `selectRange` is enabled, to render a “WIP” range when the user is selecting range. | n/a | `new Date(2017, 0, 1)` |
| maxDate | Maximum date that the user can select. Periods partially overlapped by maxDate will also be selectable, although react-calendar will ensure that no later date is selected. | n/a | Date: `new Date()` |
| minDate | Minimum date that the user can select. Periods partially overlapped by minDate will also be selectable, although react-calendar will ensure that no earlier date is selected. | n/a | Date: `new Date()` |
| onClick | Function called when the user clicks an item (day on month view, month on year view and so on). | n/a | `(value) => alert('New date is: ', value)` |
| tileClassName | Class name(s) that will be applied to a given calendar item (day on month view, month on year view and so on). | n/a | <ul><li>String: `"class1 class2"`</li><li>Array of strings: `["class1", "class2 class3"]`</li><li>Function: `({ date, view }) => view === 'month' && date.getDay() === 3 ? 'saturday' : null`</li></ul> |
| tileContent | Allows to render custom content within a given item (day on month view, month on year view and so on). Note: For tiles with custom content you might want to set fixed height of `react-calendar__tile` to ensure consistent layout. | n/a | `({ date, view }) => view === 'month' && date.getDay() === 0 ? <p>It's Sunday!</p> : null` |
| value | Calendar value. Can be either one value or an array of two values. | n/a | <ul><li>Date: `new Date()`</li><li>An array of dates: `[new Date(2017, 0, 1), new Date(2017, 7, 1)]`</li><li>String: `2017-01-01`</li><li>An array of strings: `['2017-01-01', '2017-08-01']`</li></ul> |
## Useful links
* [React-Calendar Wiki](https://github.com/wojtekmaj/react-calendar/wiki)
- [React-Calendar Wiki](https://github.com/wojtekmaj/react-calendar/wiki)

@@ -170,0 +168,0 @@ ## License

@@ -11,7 +11,11 @@ import React, { Component } from 'react';

import { getBegin, getBeginNext, getEnd, getValueRange } from './shared/dates';
import {
getBegin, getBeginNext, getEnd, getValueRange,
} from './shared/dates';
import {
isCalendarType, isClassName, isMaxDate, isMinDate, isRef, isValue, isView,
isCalendarType,
isClassName,
isMaxDate,
isMinDate,
isRef,
isValue,
isView,
} from './shared/propTypes';

@@ -92,5 +96,3 @@ import { between } from './shared/utils';

function getDetailValue({
value, minDate, maxDate, maxDetail,
}, index) {
function getDetailValue({ value, minDate, maxDate, maxDetail }, index) {
const valuePiece = getValue(value, index);

@@ -123,18 +125,12 @@

function getActiveStartDate(props) {
const {
maxDate,
maxDetail,
minDate,
minDetail,
value,
view,
} = props;
const { maxDate, maxDetail, minDate, minDetail, value, view } = props;
const rangeType = getView(view, minDetail, maxDetail);
const valueFrom = (
const valueFrom =
getDetailValueFrom({
value, minDate, maxDate, maxDetail,
})
|| new Date()
);
value,
minDate,
maxDate,
maxDetail,
}) || new Date();

@@ -177,7 +173,5 @@ return getBegin(rangeType, valueFrom);

state = {
/* eslint-disable react/destructuring-assignment */
activeStartDate: this.props.defaultActiveStartDate,
value: this.props.defaultValue,
view: this.props.defaultView,
/* eslint-enable react/destructuring-assignment */
};

@@ -246,12 +240,14 @@

getProcessedValue(value) {
const {
minDate, maxDate, maxDetail, returnValue,
} = this.props;
const { minDate, maxDate, maxDetail, returnValue } = this.props;
const processFunction = (() => {
switch (returnValue) {
case 'start': return getDetailValueFrom;
case 'end': return getDetailValueTo;
case 'range': return getDetailValueArray;
default: throw new Error('Invalid returnValue.');
case 'start':
return getDetailValueFrom;
case 'end':
return getDetailValueTo;
case 'range':
return getDetailValueArray;
default:
throw new Error('Invalid returnValue.');
}

@@ -261,3 +257,6 @@ })();

return processFunction({
value, minDate, maxDate, maxDetail,
value,
minDate,
maxDate,
maxDetail,
});

@@ -267,14 +266,6 @@ }

setStateAndCallCallbacks = (nextState, event, callback) => {
const {
activeStartDate: previousActiveStartDate,
view: previousView,
} = this;
const { activeStartDate: previousActiveStartDate, view: previousView } = this;
const {
allowPartialRange,
onActiveStartDateChange,
onChange,
onViewChange,
selectRange,
} = this.props;
const { allowPartialRange, onActiveStartDateChange, onChange, onViewChange, selectRange } =
this.props;

@@ -297,13 +288,9 @@ const prevArgs = {

// Key must exist, and…
key in nextState
&& (
// …key changed from undefined to defined or the other way around, or…
typeof nextState[key] !== typeof prevArgs[key]
key in nextState &&
// …key changed from undefined to defined or the other way around, or…
(typeof nextState[key] !== typeof prevArgs[key] ||
// …value changed.
|| (
nextState[key] instanceof Date
? nextState[key].getTime() !== prevArgs[key].getTime()
: nextState[key] !== prevArgs[key]
)
)
(nextState[key] instanceof Date
? nextState[key].getTime() !== prevArgs[key].getTime()
: nextState[key] !== prevArgs[key]))
);

@@ -338,3 +325,3 @@ }

});
}
};

@@ -349,3 +336,3 @@ /**

});
}
};

@@ -364,8 +351,12 @@ drillDown = (nextActiveStartDate, event) => {

this.setStateAndCallCallbacks({
action: 'drillDown',
activeStartDate: nextActiveStartDate,
view: nextView,
}, undefined, onDrillDown);
}
this.setStateAndCallCallbacks(
{
action: 'drillDown',
activeStartDate: nextActiveStartDate,
view: nextView,
},
undefined,
onDrillDown,
);
};

@@ -383,8 +374,12 @@ drillUp = () => {

this.setStateAndCallCallbacks({
action: 'drillUp',
activeStartDate: nextActiveStartDate,
view: nextView,
}, undefined, onDrillUp);
}
this.setStateAndCallCallbacks(
{
action: 'drillUp',
activeStartDate: nextActiveStartDate,
view: nextView,
},
undefined,
onDrillUp,
);
};

@@ -420,17 +415,15 @@ onChange = (value, event) => {

this.setStateAndCallCallbacks({
action: 'onChange',
activeStartDate: nextActiveStartDate,
value: nextValue,
}, event);
}
this.setStateAndCallCallbacks(
{
action: 'onChange',
activeStartDate: nextActiveStartDate,
value: nextValue,
},
event,
);
};
onClickTile = (value, event) => {
const { view } = this;
const {
onClickDay,
onClickDecade,
onClickMonth,
onClickYear,
} = this.props;
const { onClickDay, onClickDecade, onClickMonth, onClickYear } = this.props;

@@ -453,7 +446,7 @@ const callback = (() => {

if (callback) callback(value, event);
}
};
onMouseOver = (value) => {
this.setState((prevState) => {
if (prevState.hover && (prevState.hover.getTime() === value.getTime())) {
if (prevState.hover && prevState.hover.getTime() === value.getTime()) {
return null;

@@ -464,17 +457,11 @@ }

});
}
};
onMouseLeave = () => {
this.setState({ hover: null });
}
};
renderContent(next) {
const { activeStartDate: currentActiveStartDate, onMouseOver, valueType, value, view } = this;
const {
activeStartDate: currentActiveStartDate,
onMouseOver,
valueType,
value,
view,
} = this;
const {
calendarType,

@@ -491,7 +478,5 @@ locale,

const activeStartDate = (
next
? getBeginNext(view, currentActiveStartDate)
: getBegin(view, currentActiveStartDate)
);
const activeStartDate = next
? getBeginNext(view, currentActiveStartDate)
: getBegin(view, currentActiveStartDate);

@@ -519,8 +504,3 @@ const onClick = this.drillDownAvailable ? this.drillDown : this.onChange;

return (
<CenturyView
formatYear={formatYear}
{...commonProps}
/>
);
return <CenturyView formatYear={formatYear} {...commonProps} />;
}

@@ -530,8 +510,3 @@ case 'decade': {

return (
<DecadeView
formatYear={formatYear}
{...commonProps}
/>
);
return <DecadeView formatYear={formatYear} {...commonProps} />;
}

@@ -542,7 +517,3 @@ case 'year': {

return (
<YearView
formatMonth={formatMonth}
formatMonthYear={formatMonthYear}
{...commonProps}
/>
<YearView formatMonth={formatMonth} formatMonthYear={formatMonthYear} {...commonProps} />
);

@@ -571,3 +542,7 @@ }

onMouseLeave={selectRange ? onMouseLeave : null}
showFixedNumberOfWeeks={typeof showFixedNumberOfWeeks !== 'undefined' ? showFixedNumberOfWeeks : showDoubleView}
showFixedNumberOfWeeks={
typeof showFixedNumberOfWeeks !== 'undefined'
? showFixedNumberOfWeeks
: showDoubleView
}
showNeighboringMonth={showNeighboringMonth}

@@ -641,8 +616,3 @@ showWeekNumbers={showWeekNumbers}

render() {
const {
className,
inputRef,
selectRange,
showDoubleView,
} = this.props;
const { className, inputRef, selectRange, showDoubleView } = this.props;
const { onMouseLeave, value } = this;

@@ -686,6 +656,3 @@ const valueArray = [].concat(value);

const isActiveStartDate = PropTypes.instanceOf(Date);
const isLooseValue = PropTypes.oneOfType([
PropTypes.string,
isValue,
]);
const isLooseValue = PropTypes.oneOfType([PropTypes.string, isValue]);

@@ -740,10 +707,4 @@ Calendar.propTypes = {

showWeekNumbers: PropTypes.bool,
tileClassName: PropTypes.oneOfType([
PropTypes.func,
isClassName,
]),
tileContent: PropTypes.oneOfType([
PropTypes.func,
PropTypes.node,
]),
tileClassName: PropTypes.oneOfType([PropTypes.func, isClassName]),
tileContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
tileDisabled: PropTypes.func,

@@ -750,0 +711,0 @@ value: isLooseValue,

@@ -7,3 +7,7 @@ import React from 'react';

const { format } = new Intl.DateTimeFormat('en-US', { day: 'numeric', month: 'long', year: 'numeric' });
const { format } = new Intl.DateTimeFormat('en-US', {
day: 'numeric',
month: 'long',
year: 'numeric',
});

@@ -18,5 +22,3 @@ const event = document.createEvent('MouseEvent');

const component = shallow(
<Calendar className={className} />,
);
const component = shallow(<Calendar className={className} />);

@@ -31,5 +33,3 @@ const wrapperClassName = component.find('.react-calendar').prop('className');

mount(
<Calendar inputRef={inputRef} />,
);
mount(<Calendar inputRef={inputRef} />);

@@ -41,5 +41,3 @@ expect(inputRef).toHaveBeenCalled();

it('renders Navigation by default', () => {
const component = shallow(
<Calendar />,
);
const component = shallow(<Calendar />);

@@ -52,5 +50,3 @@ const navigation = component.find('Navigation');

it('does not render Navigation when showNavigation flag is set to false', () => {
const component = shallow(
<Calendar showNavigation={false} />,
);
const component = shallow(<Calendar showNavigation={false} />);

@@ -63,5 +59,3 @@ const navigation = component.find('Navigation');

it('uses given value when passed value using value prop', () => {
const component = shallow(
<Calendar value={new Date(2019, 0, 1)} />,
);
const component = shallow(<Calendar value={new Date(2019, 0, 1)} />);

@@ -72,5 +66,3 @@ expect(component.instance().value).toEqual(new Date(2019, 0, 1));

it('uses given value when passed value using defaultValue prop', () => {
const component = shallow(
<Calendar defaultValue={new Date(2019, 0, 1)} />,
);
const component = shallow(<Calendar defaultValue={new Date(2019, 0, 1)} />);

@@ -81,5 +73,3 @@ expect(component.instance().value).toEqual(new Date(2019, 0, 1));

it('renders given view when passed view using view prop', () => {
const component = shallow(
<Calendar view="century" />,
);
const component = shallow(<Calendar view="century" />);

@@ -90,5 +80,3 @@ expect(component.instance().view).toBe('century');

it('renders given view when passed view using defaultView prop', () => {
const component = shallow(
<Calendar defaultView="century" />,
);
const component = shallow(<Calendar defaultView="century" />);

@@ -99,5 +87,3 @@ expect(component.instance().view).toBe('century');

it('renders given active start date when passed active start date using activeStartDate prop', () => {
const component = shallow(
<Calendar activeStartDate={new Date(2019, 0, 1)} />,
);
const component = shallow(<Calendar activeStartDate={new Date(2019, 0, 1)} />);

@@ -108,5 +94,3 @@ expect(component.instance().activeStartDate).toEqual(new Date(2019, 0, 1));

it('renders given active start date when passed active start date using activeStartDate prop', () => {
const component = shallow(
<Calendar defaultActiveStartDate={new Date(2019, 0, 1)} />,
);
const component = shallow(<Calendar defaultActiveStartDate={new Date(2019, 0, 1)} />);

@@ -121,5 +105,3 @@ expect(component.instance().activeStartDate).toEqual(new Date(2019, 0, 1));

const component = shallow(
<Calendar value={value} />,
);
const component = shallow(<Calendar value={value} />);

@@ -136,5 +118,3 @@ component.setProps({ value: newValue });

const component = shallow(
<Calendar value={value} />,
);
const component = shallow(<Calendar value={value} />);

@@ -149,5 +129,3 @@ component.instance().onChange(newValue, event);

const newActiveStartDate = new Date(2018, 0, 1);
const component = shallow(
<Calendar activeStartDate={activeStartDate} />,
);
const component = shallow(<Calendar activeStartDate={activeStartDate} />);

@@ -161,5 +139,3 @@ component.setProps({ activeStartDate: newActiveStartDate });

it('renders MonthView by default', () => {
const component = shallow(
<Calendar />,
);
const component = shallow(<Calendar />);

@@ -172,5 +148,3 @@ const monthView = component.find('MonthView');

it('renders MonthView when given view = "month"', () => {
const component = shallow(
<Calendar view="month" />,
);
const component = shallow(<Calendar view="month" />);

@@ -183,5 +157,3 @@ const monthView = component.find('MonthView');

it('renders YearView when given view = "year"', () => {
const component = shallow(
<Calendar view="year" />,
);
const component = shallow(<Calendar view="year" />);

@@ -194,5 +166,3 @@ const yearView = component.find('YearView');

it('renders DecadeView when given view = "decade"', () => {
const component = shallow(
<Calendar view="decade" />,
);
const component = shallow(<Calendar view="decade" />);

@@ -205,5 +175,3 @@ const decadeView = component.find('DecadeView');

it('renders CenturyView when given view = "century"', () => {
const component = shallow(
<Calendar view="century" />,
);
const component = shallow(<Calendar view="century" />);

@@ -216,5 +184,3 @@ const centuryView = component.find('CenturyView');

it('renders maximum allowed view when given maxDetail', () => {
const component = shallow(
<Calendar maxDetail="year" />,
);
const component = shallow(<Calendar maxDetail="year" />);

@@ -227,8 +193,3 @@ const yearView = component.find('YearView');

it('renders maximum allowed view when given view that is not allowed', () => {
const component = shallow(
<Calendar
maxDetail="year"
view="month"
/>,
);
const component = shallow(<Calendar maxDetail="year" view="month" />);

@@ -241,8 +202,3 @@ const yearView = component.find('YearView');

it('renders maximum allowed view when attempting to externally switch to a view that is not allowed', () => {
const component = shallow(
<Calendar
maxDetail="year"
view="year"
/>,
);
const component = shallow(<Calendar maxDetail="year" view="year" />);

@@ -257,8 +213,3 @@ component.setProps({ view: 'month' });

it('renders maximum allowed view when given changed maxDetail', () => {
const component = shallow(
<Calendar
maxDetail="month"
view="month"
/>,
);
const component = shallow(<Calendar maxDetail="month" view="month" />);

@@ -275,7 +226,3 @@ component.setProps({ maxDetail: 'year' });

it('does not pass showWeekNumbers flag to MonthView component by default', () => {
const component = shallow(
<Calendar
view="month"
/>,
);
const component = shallow(<Calendar view="month" />);

@@ -288,8 +235,3 @@ const monthView = component.find('MonthView');

it('passes showWeekNumbers flag to MonthView component given showWeekNumbers flag', () => {
const component = shallow(
<Calendar
showWeekNumbers
view="month"
/>,
);
const component = shallow(<Calendar showWeekNumbers view="month" />);

@@ -302,8 +244,3 @@ const monthView = component.find('MonthView');

it('passes showNeighboringMonth flag to MonthView component given showNeighboringMonth flag', () => {
const component = shallow(
<Calendar
showNeighboringMonth
view="month"
/>,
);
const component = shallow(<Calendar showNeighboringMonth view="month" />);

@@ -318,7 +255,3 @@ const monthView = component.find('MonthView');

const defaultValue = new Date(2017, 0, 15);
const component = shallow(
<Calendar
defaultValue={defaultValue}
/>,
);
const component = shallow(<Calendar defaultValue={defaultValue} />);

@@ -332,7 +265,3 @@ const monthView = component.find('MonthView');

const value = new Date(2017, 0, 15);
const component = shallow(
<Calendar
value={value}
/>,
);
const component = shallow(<Calendar value={value} />);

@@ -348,6 +277,3 @@ const monthView = component.find('MonthView');

const component = shallow(
<Calendar
defaultActiveStartDate={defaultActiveStartDate}
value={value}
/>,
<Calendar defaultActiveStartDate={defaultActiveStartDate} value={value} />,
);

@@ -362,7 +288,3 @@

const defaultActiveStartDate = new Date(2017, 0, 1);
const component = shallow(
<Calendar
defaultActiveStartDate={defaultActiveStartDate}
/>,
);
const component = shallow(<Calendar defaultActiveStartDate={defaultActiveStartDate} />);

@@ -376,7 +298,3 @@ const monthView = component.find('MonthView');

const activeStartDate = new Date(2017, 0, 1);
const component = shallow(
<Calendar
activeStartDate={activeStartDate}
/>,
);
const component = shallow(<Calendar activeStartDate={activeStartDate} />);

@@ -388,8 +306,6 @@ const monthView = component.find('MonthView');

it('displays a view with today\'s date when no value and no activeStartDate is given', () => {
it("displays a view with today's date when no value and no activeStartDate is given", () => {
const today = new Date();
const beginOfCurrentMonth = getMonthStart(today);
const component = shallow(
<Calendar />,
);
const component = shallow(<Calendar />);

@@ -403,5 +319,3 @@ const monthView = component.find('MonthView');

const defaultActiveStartDate = new Date(2012, 5, 6);
const component = mount(
<Calendar defaultActiveStartDate={defaultActiveStartDate} />,
);
const component = mount(<Calendar defaultActiveStartDate={defaultActiveStartDate} />);

@@ -417,5 +331,3 @@ const firstDayTile = component.find('.react-calendar__tile').first();

const activeStartDate = new Date(2012, 5, 6);
const component = mount(
<Calendar activeStartDate={activeStartDate} />,
);
const component = mount(<Calendar activeStartDate={activeStartDate} />);

@@ -432,5 +344,3 @@ const firstDayTile = component.find('.react-calendar__tile').first();

it('drills up when allowed', () => {
const component = shallow(
<Calendar />,
);
const component = shallow(<Calendar />);

@@ -448,7 +358,3 @@ component.setState({ view: 'month' });

const component = shallow(
<Calendar
activeStartDate={new Date(2017, 6, 1)}
onDrillUp={onDrillUp}
view="month"
/>,
<Calendar activeStartDate={new Date(2017, 6, 1)} onDrillUp={onDrillUp} view="month" />,
);

@@ -469,6 +375,3 @@

const component = shallow(
<Calendar
activeStartDate={new Date(2017, 6, 1)}
onDrillUp={onDrillUp}
/>,
<Calendar activeStartDate={new Date(2017, 6, 1)} onDrillUp={onDrillUp} />,
);

@@ -490,8 +393,3 @@

const component = shallow(
<Calendar
onDrillUp={onDrillUp}
view="century"
/>,
);
const component = shallow(<Calendar onDrillUp={onDrillUp} view="century" />);

@@ -506,5 +404,3 @@ component.instance().drillUp();

it('drills down when allowed', () => {
const component = shallow(
<Calendar />,
);
const component = shallow(<Calendar />);

@@ -542,6 +438,3 @@ component.setState({ view: 'century' });

const component = shallow(
<Calendar
activeStartDate={new Date(2001, 0, 1)}
onDrillDown={onDrillDown}
/>,
<Calendar activeStartDate={new Date(2001, 0, 1)} onDrillDown={onDrillDown} />,
);

@@ -563,8 +456,3 @@

const component = shallow(
<Calendar
onDrillDown={onDrillDown}
view="month"
/>,
);
const component = shallow(<Calendar onDrillDown={onDrillDown} view="month" />);

@@ -579,5 +467,3 @@ component.instance().drillUp();

it('changes active start date when allowed', () => {
const component = shallow(
<Calendar />,
);
const component = shallow(<Calendar />);

@@ -594,7 +480,3 @@ component.instance().setActiveStartDate(new Date(2019, 0, 1));

const component = shallow(
<Calendar
onActiveStartDateChange={onActiveStartDateChange}
value={value}
view="year"
/>,
<Calendar onActiveStartDateChange={onActiveStartDateChange} value={value} view="year" />,
);

@@ -656,7 +538,3 @@

const component = shallow(
<Calendar
onActiveStartDateChange={onActiveStartDateChange}
value={value}
view="year"
/>,
<Calendar onActiveStartDateChange={onActiveStartDateChange} value={value} view="year" />,
);

@@ -677,7 +555,3 @@

const component = shallow(
<Calendar
activeStartDate={activeStartDate}
onViewChange={onViewChange}
value={value}
/>,
<Calendar activeStartDate={activeStartDate} onViewChange={onViewChange} value={value} />,
);

@@ -722,8 +596,3 @@

const onViewChange = jest.fn();
const component = shallow(
<Calendar
onViewChange={onViewChange}
view={view}
/>,
);
const component = shallow(<Calendar onViewChange={onViewChange} view={view} />);

@@ -739,8 +608,3 @@ component.instance().setStateAndCallCallbacks({ view: newView });

const onChange = jest.fn();
const component = shallow(
<Calendar
onChange={onChange}
view="month"
/>,
);
const component = shallow(<Calendar onChange={onChange} view="month" />);

@@ -754,9 +618,3 @@ component.instance().onChange(new Date(2017, 0, 1), event);

const onChange = jest.fn();
const component = shallow(
<Calendar
onChange={onChange}
returnValue="start"
view="month"
/>,
);
const component = shallow(<Calendar onChange={onChange} returnValue="start" view="month" />);

@@ -770,9 +628,3 @@ component.instance().onChange(new Date(2017, 0, 1), event);

const onChange = jest.fn();
const component = shallow(
<Calendar
onChange={onChange}
returnValue="end"
view="month"
/>,
);
const component = shallow(<Calendar onChange={onChange} returnValue="end" view="month" />);

@@ -786,16 +638,10 @@ component.instance().onChange(new Date(2017, 0, 1), event);

const onChange = jest.fn();
const component = shallow(
<Calendar
onChange={onChange}
returnValue="range"
view="month"
/>,
);
const component = shallow(<Calendar onChange={onChange} returnValue="range" view="month" />);
component.instance().onChange(new Date(2017, 0, 1), event);
expect(onChange).toHaveBeenCalledWith([
new Date(2017, 0, 1),
new Date(2017, 0, 1, 23, 59, 59, 999),
], event);
expect(onChange).toHaveBeenCalledWith(
[new Date(2017, 0, 1), new Date(2017, 0, 1, 23, 59, 59, 999)],
event,
);
});

@@ -869,9 +715,3 @@

const onChange = jest.fn();
const component = shallow(
<Calendar
onChange={onChange}
selectRange
view="month"
/>,
);
const component = shallow(<Calendar onChange={onChange} selectRange view="month" />);

@@ -886,8 +726,3 @@ component.instance().onChange(new Date(2018, 0, 1), event);

const component = shallow(
<Calendar
allowPartialRange={false}
onChange={onChange}
selectRange
view="month"
/>,
<Calendar allowPartialRange={false} onChange={onChange} selectRange view="month" />,
);

@@ -903,8 +738,3 @@

const component = shallow(
<Calendar
allowPartialRange
onChange={onChange}
selectRange
view="month"
/>,
<Calendar allowPartialRange onChange={onChange} selectRange view="month" />,
);

@@ -915,5 +745,3 @@

expect(onChange).toHaveBeenCalledTimes(1);
expect(onChange).toHaveBeenCalledWith([
new Date(2018, 0, 1),
], event);
expect(onChange).toHaveBeenCalledWith([new Date(2018, 0, 1)], event);
});

@@ -923,9 +751,3 @@

const onChange = jest.fn();
const component = shallow(
<Calendar
onChange={onChange}
selectRange
view="month"
/>,
);
const component = shallow(<Calendar onChange={onChange} selectRange view="month" />);

@@ -936,6 +758,6 @@ component.instance().onChange(new Date(2018, 0, 1), event);

expect(onChange).toHaveBeenCalledTimes(1);
expect(onChange).toHaveBeenCalledWith([
new Date(2018, 0, 1),
new Date(2018, 6, 1, 23, 59, 59, 999),
], event);
expect(onChange).toHaveBeenCalledWith(
[new Date(2018, 0, 1), new Date(2018, 6, 1, 23, 59, 59, 999)],
event,
);
});

@@ -945,9 +767,3 @@

const onChange = jest.fn();
const component = shallow(
<Calendar
onChange={onChange}
selectRange
view="month"
/>,
);
const component = shallow(<Calendar onChange={onChange} selectRange view="month" />);

@@ -958,6 +774,6 @@ component.instance().onChange(new Date(2018, 6, 1), event);

expect(onChange).toHaveBeenCalledTimes(1);
expect(onChange).toHaveBeenCalledWith([
new Date(2018, 0, 1),
new Date(2018, 6, 1, 23, 59, 59, 999),
], event);
expect(onChange).toHaveBeenCalledWith(
[new Date(2018, 0, 1), new Date(2018, 6, 1, 23, 59, 59, 999)],
event,
);
});

@@ -968,7 +784,3 @@ });

const formatMonthYear = () => 'Month year';
const component = shallow(
<Calendar
formatMonthYear={formatMonthYear}
/>,
);
const component = shallow(<Calendar formatMonthYear={formatMonthYear} />);

@@ -982,7 +794,3 @@ const navigation = component.find('Navigation');

const formatYear = () => 'Year';
const component = shallow(
<Calendar
formatYear={formatYear}
/>,
);
const component = shallow(<Calendar formatYear={formatYear} />);

@@ -996,7 +804,3 @@ const navigation = component.find('Navigation');

const formatDay = () => 'Day';
const component = shallow(
<Calendar
formatDay={formatDay}
/>,
);
const component = shallow(<Calendar formatDay={formatDay} />);

@@ -1010,7 +814,3 @@ const monthView = component.find('MonthView');

const formatLongDate = () => 'Long date';
const component = shallow(
<Calendar
formatLongDate={formatLongDate}
/>,
);
const component = shallow(<Calendar formatLongDate={formatLongDate} />);

@@ -1024,7 +824,3 @@ const monthView = component.find('MonthView');

const formatShortWeekday = () => 'Weekday';
const component = shallow(
<Calendar
formatShortWeekday={formatShortWeekday}
/>,
);
const component = shallow(<Calendar formatShortWeekday={formatShortWeekday} />);

@@ -1038,8 +834,3 @@ const monthView = component.find('MonthView');

const formatMonth = () => 'Month';
const component = shallow(
<Calendar
formatMonth={formatMonth}
view="year"
/>,
);
const component = shallow(<Calendar formatMonth={formatMonth} view="year" />);

@@ -1053,8 +844,3 @@ const yearView = component.find('YearView');

const formatYear = () => 'Year';
const component = shallow(
<Calendar
formatYear={formatYear}
view="decade"
/>,
);
const component = shallow(<Calendar formatYear={formatYear} view="decade" />);

@@ -1068,8 +854,3 @@ const decadeView = component.find('DecadeView');

const formatYear = () => 'Year';
const component = shallow(
<Calendar
formatYear={formatYear}
view="century"
/>,
);
const component = shallow(<Calendar formatYear={formatYear} view="century" />);

@@ -1076,0 +857,0 @@ const centuryView = component.find('CenturyView');

@@ -51,6 +51,4 @@ import React from 'react';

const previousActiveStartDate = getBeginPrevious(view, activeStartDate);
const previousActiveStartDate2 = (
shouldShowPrevNext2Buttons
&& getBeginPrevious2(view, activeStartDate)
);
const previousActiveStartDate2 =
shouldShowPrevNext2Buttons && getBeginPrevious2(view, activeStartDate);
const nextActiveStartDate = getBeginNext(view, activeStartDate);

@@ -67,17 +65,16 @@ const nextActiveStartDate2 = shouldShowPrevNext2Buttons && getBeginNext2(view, activeStartDate);

const prev2ButtonDisabled = shouldShowPrevNext2Buttons && (() => {
if (previousActiveStartDate2.getFullYear() < 0) {
return true;
}
const previousActiveEndDate = getEndPrevious2(view, activeStartDate);
return minDate && minDate >= previousActiveEndDate;
})();
const prev2ButtonDisabled =
shouldShowPrevNext2Buttons &&
(() => {
if (previousActiveStartDate2.getFullYear() < 0) {
return true;
}
const previousActiveEndDate = getEndPrevious2(view, activeStartDate);
return minDate && minDate >= previousActiveEndDate;
})();
const nextButtonDisabled = maxDate && maxDate < nextActiveStartDate;
const next2ButtonDisabled = (
shouldShowPrevNext2Buttons
&& maxDate
&& maxDate < nextActiveStartDate2
);
const next2ButtonDisabled =
shouldShowPrevNext2Buttons && maxDate && maxDate < nextActiveStartDate2;

@@ -116,5 +113,4 @@ function onClickPrevious() {

return (
navigationLabel
? navigationLabel({
return navigationLabel
? navigationLabel({
date,

@@ -125,4 +121,3 @@ label,

})
: label
);
: label;
}

@@ -147,7 +142,3 @@

<>
<span className={`${labelClassName}__divider`}>
{' '}
{' '}
</span>
<span className={`${labelClassName}__divider`}> – </span>
<span className={`${labelClassName}__labelText ${labelClassName}__labelText--to`}>

@@ -154,0 +145,0 @@ {renderLabel(nextActiveStartDate)}

@@ -17,8 +17,3 @@ import React from 'react';

it('renders prev2, prev, drill up, next and next2 buttons', () => {
const component = shallow(
<Navigation
{...defaultProps}
view="month"
/>,
);
const component = shallow(<Navigation {...defaultProps} view="month" />);

@@ -38,8 +33,3 @@ const children = component.children();

it('renders prev, drill up, next and buttons only for century view', () => {
const component = shallow(
<Navigation
{...defaultProps}
view="century"
/>,
);
const component = shallow(<Navigation {...defaultProps} view="century" />);

@@ -57,8 +47,3 @@ const children = component.children();

it('displays proper title for month view', () => {
const component = shallow(
<Navigation
{...defaultProps}
view="month"
/>,
);
const component = shallow(<Navigation {...defaultProps} view="month" />);

@@ -71,8 +56,3 @@ const drillUp = component.find('.react-calendar__navigation__label');

it('displays proper title for year view', () => {
const component = shallow(
<Navigation
{...defaultProps}
view="year"
/>,
);
const component = shallow(<Navigation {...defaultProps} view="year" />);

@@ -85,8 +65,3 @@ const drillUp = component.find('.react-calendar__navigation__label');

it('displays proper title for decade view', () => {
const component = shallow(
<Navigation
{...defaultProps}
view="decade"
/>,
);
const component = shallow(<Navigation {...defaultProps} view="decade" />);

@@ -99,8 +74,3 @@ const drillUp = component.find('.react-calendar__navigation__label');

it('displays proper title for century view', () => {
const component = shallow(
<Navigation
{...defaultProps}
view="century"
/>,
);
const component = shallow(<Navigation {...defaultProps} view="century" />);

@@ -113,9 +83,3 @@ const drillUp = component.find('.react-calendar__navigation__label');

it('displays proper title for month view given showDouble flags is set to true', () => {
const component = shallow(
<Navigation
{...defaultProps}
showDoubleView
view="month"
/>,
);
const component = shallow(<Navigation {...defaultProps} showDoubleView view="month" />);

@@ -149,7 +113,3 @@ const drillUp = component.find('.react-calendar__navigation__label');

const component = shallow(
<Navigation
{...defaultProps}
navigationAriaLive="polite"
view="month"
/>,
<Navigation {...defaultProps} navigationAriaLive="polite" view="month" />,
);

@@ -186,9 +146,3 @@

const drillUpFn = jest.fn();
const component = shallow(
<Navigation
{...defaultProps}
drillUp={drillUpFn}
view="month"
/>,
);
const component = shallow(<Navigation {...defaultProps} drillUp={drillUpFn} view="month" />);

@@ -205,7 +159,3 @@ const button = component.find('button.react-calendar__navigation__label');

const component = shallow(
<Navigation
{...defaultProps}
setActiveStartDate={setActiveStartDateFn}
view="month"
/>,
<Navigation {...defaultProps} setActiveStartDate={setActiveStartDateFn} view="month" />,
);

@@ -231,7 +181,3 @@

const monthViewComponent = shallow(
<Navigation
{...defaultProps}
setActiveStartDate={monthSetActiveStartDateFn}
view="month"
/>,
<Navigation {...defaultProps} setActiveStartDate={monthSetActiveStartDateFn} view="month" />,
);

@@ -276,7 +222,3 @@

const yearViewComponent = shallow(
<Navigation
{...defaultProps}
setActiveStartDate={yearSetActiveStartDateFn}
view="year"
/>,
<Navigation {...defaultProps} setActiveStartDate={yearSetActiveStartDateFn} view="year" />,
);

@@ -321,7 +263,3 @@

const decadeViewComponent = shallow(
<Navigation
{...defaultProps}
setActiveStartDate={decadeSetActiveStartDateFn}
view="decade"
/>,
<Navigation {...defaultProps} setActiveStartDate={decadeSetActiveStartDateFn} view="decade" />,
);

@@ -392,8 +330,3 @@

it('correctly marks drillUp button as disabled when already on top allowed view', () => {
const component = shallow(
<Navigation
{...defaultProps}
view="century"
/>,
);
const component = shallow(<Navigation {...defaultProps} view="century" />);

@@ -407,7 +340,3 @@ const button = component.find('button.react-calendar__navigation__label');

const component = shallow(
<Navigation
{...defaultProps}
minDate={new Date(2017, 0, 1)}
view="month"
/>,
<Navigation {...defaultProps} minDate={new Date(2017, 0, 1)} view="month" />,
);

@@ -425,8 +354,3 @@

it('disallows navigating before dynamically set minDate', () => {
const component = shallow(
<Navigation
{...defaultProps}
view="month"
/>,
);
const component = shallow(<Navigation {...defaultProps} view="month" />);

@@ -448,7 +372,3 @@ component.setProps({

const component = shallow(
<Navigation
{...defaultProps}
maxDate={new Date(2017, 0, 31)}
view="month"
/>,
<Navigation {...defaultProps} maxDate={new Date(2017, 0, 31)} view="month" />,
);

@@ -467,7 +387,3 @@

const component = shallow(
<Navigation
{...defaultProps}
maxDate={new Date(2017, 1, 1)}
view="month"
/>,
<Navigation {...defaultProps} maxDate={new Date(2017, 1, 1)} view="month" />,
);

@@ -486,7 +402,3 @@

const component = shallow(
<Navigation
{...defaultProps}
maxDate={new Date(2018, 0, 1)}
view="month"
/>,
<Navigation {...defaultProps} maxDate={new Date(2018, 0, 1)} view="month" />,
);

@@ -504,8 +416,3 @@

it('disallows navigating after dynamically set maxDate', () => {
const component = shallow(
<Navigation
{...defaultProps}
view="month"
/>,
);
const component = shallow(<Navigation {...defaultProps} view="month" />);

@@ -530,7 +437,3 @@ component.setProps({

const component = shallow(
<Navigation
{...defaultProps}
activeStartDate={activeStartDate}
view="year"
/>,
<Navigation {...defaultProps} activeStartDate={activeStartDate} view="year" />,
);

@@ -579,7 +482,3 @@

const component = shallow(
<Navigation
{...defaultProps}
formatMonthYear={() => 'MonthYear'}
view="month"
/>,
<Navigation {...defaultProps} formatMonthYear={() => 'MonthYear'} view="month" />,
);

@@ -594,7 +493,3 @@

const component = shallow(
<Navigation
{...defaultProps}
formatYear={() => 'Year'}
view="year"
/>,
<Navigation {...defaultProps} formatYear={() => 'Year'} view="year" />,
);

@@ -609,7 +504,3 @@

const component = shallow(
<Navigation
{...defaultProps}
formatYear={() => 'Year'}
view="decade"
/>,
<Navigation {...defaultProps} formatYear={() => 'Year'} view="decade" />,
);

@@ -624,7 +515,3 @@

const component = shallow(
<Navigation
{...defaultProps}
formatYear={() => 'Year'}
view="century"
/>,
<Navigation {...defaultProps} formatYear={() => 'Year'} view="century" />,
);

@@ -631,0 +518,0 @@

@@ -7,12 +7,6 @@ import React from 'react';

function renderDecades() {
return (
<Decades {...props} />
);
return <Decades {...props} />;
}
return (
<div className="react-calendar__century-view">
{renderDecades()}
</div>
);
return <div className="react-calendar__century-view">{renderDecades()}</div>;
}

@@ -24,3 +24,7 @@ import React from 'react';

expect(firstDayTile.text()).toBe(`${getDecadeStart(activeStartDate).getFullYear()} – ${getDecadeEnd(activeStartDate).getFullYear()}`);
expect(firstDayTile.text()).toBe(
`${getDecadeStart(activeStartDate).getFullYear()} – ${getDecadeEnd(
activeStartDate,
).getFullYear()}`,
);
});

@@ -31,7 +35,3 @@

const component = mount(
<CenturyView
{...defaultProps}
showNeighboringMonth={false}
tileClassName={tileClassName}
/>,
<CenturyView {...defaultProps} showNeighboringMonth={false} tileClassName={tileClassName} />,
);

@@ -75,11 +75,5 @@

it('renders tileContent in its tiles when given a node', () => {
const tileContent = (
<div className="testContent" />
);
const tileContent = <div className="testContent" />;
const component = mount(
<CenturyView
{...defaultProps}
showNeighboringMonth={false}
tileContent={tileContent}
/>,
<CenturyView {...defaultProps} showNeighboringMonth={false} tileContent={tileContent} />,
);

@@ -99,5 +93,3 @@

if (date.getTime() === activeStartDate.getTime()) {
return (
<div className="testContent" />
);
return <div className="testContent" />;
}

@@ -130,8 +122,3 @@

const component = shallow(
<CenturyView
{...defaultProps}
formatYear={formatYear}
/>,
);
const component = shallow(<CenturyView {...defaultProps} formatYear={formatYear} />);

@@ -138,0 +125,0 @@ const years = component.find('Decades');

@@ -13,7 +13,3 @@ import React from 'react';

export default function Decade({
classes,
formatYear = defaultFormatYear,
...otherProps
}) {
export default function Decade({ classes, formatYear = defaultFormatYear, ...otherProps }) {
const { date, locale } = otherProps;

@@ -20,0 +16,0 @@

@@ -6,4 +6,2 @@ import React from 'react';

/* eslint-disable jsx-a11y/mouse-events-have-key-events */
const tileProps = {

@@ -35,9 +33,3 @@ activeStartDate: new Date(2018, 0, 1),

it('renders component without abbreviation', () => {
const component = mount(
<Decade
{...tileProps}
date={new Date(2018, 0, 1)}
decade={2011}
/>,
);
const component = mount(<Decade {...tileProps} date={new Date(2018, 0, 1)} decade={2011} />);

@@ -50,9 +42,5 @@ const abbr = component.find('abbr');

it('is disabled when date is before beginning of minDate\'s decade', () => {
it("is disabled when date is before beginning of minDate's decade", () => {
const component = mount(
<Decade
{...tileProps}
date={new Date(2010, 0, 1)}
minDate={new Date(2020, 0, 1)}
/>,
<Decade {...tileProps} date={new Date(2010, 0, 1)} minDate={new Date(2020, 0, 1)} />,
);

@@ -63,9 +51,5 @@

it('is not disabled when date is after beginning of minDate\'s decade', () => {
it("is not disabled when date is after beginning of minDate's decade", () => {
const component = mount(
<Decade
{...tileProps}
date={new Date(2010, 0, 1)}
minDate={new Date(2010, 0, 1)}
/>,
<Decade {...tileProps} date={new Date(2010, 0, 1)} minDate={new Date(2010, 0, 1)} />,
);

@@ -76,9 +60,5 @@

it('is disabled when date is after end of maxDate\'s decade', () => {
it("is disabled when date is after end of maxDate's decade", () => {
const component = mount(
<Decade
{...tileProps}
date={new Date(2020, 0, 1)}
maxDate={new Date(2010, 0, 1)}
/>,
<Decade {...tileProps} date={new Date(2020, 0, 1)} maxDate={new Date(2010, 0, 1)} />,
);

@@ -89,9 +69,5 @@

it('is not disabled when date is before end of maxDate\'s decade', () => {
it("is not disabled when date is before end of maxDate's decade", () => {
const component = mount(
<Decade
{...tileProps}
date={new Date(2010, 0, 1)}
maxDate={new Date(2010, 0, 1)}
/>,
<Decade {...tileProps} date={new Date(2010, 0, 1)} maxDate={new Date(2010, 0, 1)} />,
);

@@ -106,9 +82,3 @@

const component = mount(
<Decade
{...tileProps}
date={date}
onClick={onClick}
/>,
);
const component = mount(<Decade {...tileProps} date={date} onClick={onClick} />);

@@ -125,9 +95,3 @@ component.find('.react-calendar__tile').simulate('click');

const component = mount(
<Decade
{...tileProps}
date={date}
onMouseOver={onMouseOver}
/>,
);
const component = mount(<Decade {...tileProps} date={date} onMouseOver={onMouseOver} />);

@@ -144,9 +108,3 @@ component.find('.react-calendar__tile').simulate('mouseOver');

const component = mount(
<Decade
{...tileProps}
date={date}
onMouseOver={onMouseOver}
/>,
);
const component = mount(<Decade {...tileProps} date={date} onMouseOver={onMouseOver} />);

@@ -161,6 +119,3 @@ component.find('.react-calendar__tile').simulate('focus');

const component = mount(
<Decade
{...tileProps}
tileContent={<div className="testContent" />}
/>,
<Decade {...tileProps} tileContent={<div className="testContent" />} />,
);

@@ -178,9 +133,3 @@

const component = mount(
<Decade
{...tileProps}
date={date}
tileContent={tileContent}
/>,
);
const component = mount(<Decade {...tileProps} date={date} tileContent={tileContent} />);

@@ -205,8 +154,3 @@ const testContent = component.find('.testContent');

const component = mount(
<Decade
{...tileProps}
date={date}
formatYear={formatYear}
locale={locale}
/>,
<Decade {...tileProps} date={date} formatYear={formatYear} locale={locale} />,
);

@@ -213,0 +157,0 @@

@@ -7,12 +7,6 @@ import React from 'react';

function renderYears() {
return (
<Years {...props} />
);
return <Years {...props} />;
}
return (
<div className="react-calendar__decade-view">
{renderYears()}
</div>
);
return <div className="react-calendar__decade-view">{renderYears()}</div>;
}

@@ -29,7 +29,3 @@ import React from 'react';

const component = mount(
<DecadeView
{...defaultProps}
showNeighboringMonth={false}
tileClassName={tileClassName}
/>,
<DecadeView {...defaultProps} showNeighboringMonth={false} tileClassName={tileClassName} />,
);

@@ -73,11 +69,5 @@

it('renders tileContent in its tiles when given a node', () => {
const tileContent = (
<div className="testContent" />
);
const tileContent = <div className="testContent" />;
const component = mount(
<DecadeView
{...defaultProps}
showNeighboringMonth={false}
tileContent={tileContent}
/>,
<DecadeView {...defaultProps} showNeighboringMonth={false} tileContent={tileContent} />,
);

@@ -97,5 +87,3 @@

if (date.getTime() === activeStartDate.getTime()) {
return (
<div className="testContent" />
);
return <div className="testContent" />;
}

@@ -128,8 +116,3 @@

const component = shallow(
<DecadeView
{...defaultProps}
formatYear={formatYear}
/>,
);
const component = shallow(<DecadeView {...defaultProps} formatYear={formatYear} />);

@@ -136,0 +119,0 @@ const years = component.find('Years');

@@ -12,7 +12,3 @@ import React from 'react';

export default function Year({
classes,
formatYear = defaultFormatYear,
...otherProps
}) {
export default function Year({ classes, formatYear = defaultFormatYear, ...otherProps }) {
const { date, locale } = otherProps;

@@ -19,0 +15,0 @@

@@ -6,4 +6,2 @@ import React from 'react';

/* eslint-disable jsx-a11y/mouse-events-have-key-events */
const tileProps = {

@@ -35,9 +33,3 @@ activeStartDate: new Date(2018, 0, 1),

it('renders component without abbreviation', () => {
const component = mount(
<Year
{...tileProps}
date={new Date(2018, 0, 1)}
year={2018}
/>,
);
const component = mount(<Year {...tileProps} date={new Date(2018, 0, 1)} year={2018} />);

@@ -50,9 +42,5 @@ const abbr = component.find('abbr');

it('is disabled when date is before beginning of minDate\'s year', () => {
it("is disabled when date is before beginning of minDate's year", () => {
const component = mount(
<Year
{...tileProps}
date={new Date(2018, 0, 1)}
minDate={new Date(2019, 0, 1)}
/>,
<Year {...tileProps} date={new Date(2018, 0, 1)} minDate={new Date(2019, 0, 1)} />,
);

@@ -63,9 +51,5 @@

it('is not disabled when date is after beginning of minDate\'s year', () => {
it("is not disabled when date is after beginning of minDate's year", () => {
const component = mount(
<Year
{...tileProps}
date={new Date(2018, 0, 1)}
minDate={new Date(2018, 0, 1)}
/>,
<Year {...tileProps} date={new Date(2018, 0, 1)} minDate={new Date(2018, 0, 1)} />,
);

@@ -76,9 +60,5 @@

it('is disabled when date is after end of maxDate\'s year', () => {
it("is disabled when date is after end of maxDate's year", () => {
const component = mount(
<Year
{...tileProps}
date={new Date(2018, 0, 1)}
maxDate={new Date(2017, 0, 1)}
/>,
<Year {...tileProps} date={new Date(2018, 0, 1)} maxDate={new Date(2017, 0, 1)} />,
);

@@ -89,9 +69,5 @@

it('is not disabled when date is before end of maxDate\'s year', () => {
it("is not disabled when date is before end of maxDate's year", () => {
const component = mount(
<Year
{...tileProps}
date={new Date(2018, 0, 1)}
maxDate={new Date(2018, 0, 1)}
/>,
<Year {...tileProps} date={new Date(2018, 0, 1)} maxDate={new Date(2018, 0, 1)} />,
);

@@ -106,9 +82,3 @@

const component = mount(
<Year
{...tileProps}
date={date}
onClick={onClick}
/>,
);
const component = mount(<Year {...tileProps} date={date} onClick={onClick} />);

@@ -125,9 +95,3 @@ component.find('.react-calendar__tile').simulate('click');

const component = mount(
<Year
{...tileProps}
date={date}
onMouseOver={onMouseOver}
/>,
);
const component = mount(<Year {...tileProps} date={date} onMouseOver={onMouseOver} />);

@@ -144,9 +108,3 @@ component.find('.react-calendar__tile').simulate('mouseOver');

const component = mount(
<Year
{...tileProps}
date={date}
onMouseOver={onMouseOver}
/>,
);
const component = mount(<Year {...tileProps} date={date} onMouseOver={onMouseOver} />);

@@ -160,8 +118,3 @@ component.find('.react-calendar__tile').simulate('focus');

it('renders tileContent properly', () => {
const component = mount(
<Year
{...tileProps}
tileContent={<div className="testContent" />}
/>,
);
const component = mount(<Year {...tileProps} tileContent={<div className="testContent" />} />);

@@ -178,9 +131,3 @@ const testContent = component.find('.testContent');

const component = mount(
<Year
{...tileProps}
date={date}
tileContent={tileContent}
/>,
);
const component = mount(<Year {...tileProps} date={date} tileContent={tileContent} />);

@@ -205,8 +152,3 @@ const testContent = component.find('.testContent');

const component = mount(
<Year
{...tileProps}
date={date}
formatYear={formatYear}
locale={locale}
/>,
<Year {...tileProps} date={date} formatYear={formatYear} locale={locale} />,
);

@@ -213,0 +155,0 @@

@@ -29,17 +29,14 @@ import React from 'react';

>
{React.Children.map(children, (child, index) => (
React.cloneElement(
child,
{
...child.props,
style: {
flexBasis: toPercent(100 / count),
flexShrink: 0,
flexGrow: 0,
overflow: 'hidden',
marginLeft: offset && (index === 0) ? toPercent((100 * offset) / count) : null,
},
{React.Children.map(children, (child, index) =>
React.cloneElement(child, {
...child.props,
style: {
flexBasis: toPercent(100 / count),
flexShrink: 0,
flexGrow: 0,
overflow: 'hidden',
marginLeft: offset && index === 0 ? toPercent((100 * offset) / count) : null,
},
)
))}
}),
)}
</div>

@@ -55,7 +52,4 @@ );

offset: PropTypes.number,
style: PropTypes.objectOf(PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
])),
style: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
wrap: PropTypes.bool,
};

@@ -10,11 +10,5 @@ import React from 'react';

<Flex count={3} wrap={false}>
<div>
Hey
</div>
<div>
Hi
</div>
<div>
Hello
</div>
<div>Hey</div>
<div>Hi</div>
<div>Hello</div>
</Flex>,

@@ -30,11 +24,5 @@ );

<Flex count={3} wrap>
<div>
Hey
</div>
<div>
Hi
</div>
<div>
Hello
</div>
<div>Hey</div>
<div>Hi</div>
<div>Hello</div>
</Flex>,

@@ -50,11 +38,5 @@ );

<Flex count={3}>
<div>
Hey
</div>
<div>
Hi
</div>
<div>
Hello
</div>
<div>Hey</div>
<div>Hi</div>
<div>Hello</div>
</Flex>,

@@ -74,8 +56,4 @@ );

<Flex count={3} offset={1}>
<div>
Hey
</div>
<div>
Hi
</div>
<div>Hey</div>
<div>Hi</div>
</Flex>,

@@ -86,5 +64,7 @@ );

children.forEach((child) => expect(parseFloat(child.prop('style').flexBasis)).toBeCloseTo(33.33));
children.forEach((child) =>
expect(parseFloat(child.prop('style').flexBasis)).toBeCloseTo(33.33),
);
expect(parseFloat(children.first().prop('style').marginLeft)).toBeCloseTo(33.33);
});
});

@@ -9,8 +9,2 @@ import Calendar from './Calendar';

export {
Calendar,
CenturyView,
DecadeView,
YearView,
MonthView,
};
export { Calendar, CenturyView, DecadeView, YearView, MonthView };

@@ -14,5 +14,5 @@ import React from 'react';

return (
Object.keys(CALENDAR_TYPE_LOCALES)
.find((calendarType) => CALENDAR_TYPE_LOCALES[calendarType].includes(locale))
|| CALENDAR_TYPES.ISO_8601
Object.keys(CALENDAR_TYPE_LOCALES).find((calendarType) =>
CALENDAR_TYPE_LOCALES[calendarType].includes(locale),
) || CALENDAR_TYPES.ISO_8601
);

@@ -22,9 +22,4 @@ }

export default function MonthView(props) {
const { activeStartDate, locale, onMouseLeave, showFixedNumberOfWeeks } = props;
const {
activeStartDate,
locale,
onMouseLeave,
showFixedNumberOfWeeks,
} = props;
const {
calendarType = getCalendarTypeFromLocale(locale),

@@ -65,8 +60,3 @@ formatShortWeekday,

function renderDays() {
return (
<Days
calendarType={calendarType}
{...childProps}
/>
);
return <Days calendarType={calendarType} {...childProps} />;
}

@@ -77,5 +67,3 @@

return (
<div
className={mergeClassNames(className, showWeekNumbers ? `${className}--weekNumbers` : '')}
>
<div className={mergeClassNames(className, showWeekNumbers ? `${className}--weekNumbers` : '')}>
<div

@@ -82,0 +70,0 @@ style={{

@@ -6,3 +6,7 @@ import React from 'react';

const { format } = new Intl.DateTimeFormat('en-US', { day: 'numeric', month: 'long', year: 'numeric' });
const { format } = new Intl.DateTimeFormat('en-US', {
day: 'numeric',
month: 'long',
year: 'numeric',
});

@@ -33,7 +37,3 @@ describe('MonthView', () => {

const component = mount(
<MonthView
{...defaultProps}
showNeighboringMonth={false}
tileClassName={tileClassName}
/>,
<MonthView {...defaultProps} showNeighboringMonth={false} tileClassName={tileClassName} />,
);

@@ -77,11 +77,5 @@

it('renders tileContent in its tiles when given a node', () => {
const tileContent = (
<div className="testContent" />
);
const tileContent = <div className="testContent" />;
const component = mount(
<MonthView
{...defaultProps}
showNeighboringMonth={false}
tileContent={tileContent}
/>,
<MonthView {...defaultProps} showNeighboringMonth={false} tileContent={tileContent} />,
);

@@ -101,5 +95,3 @@

if (date.getTime() === activeStartDate.getTime()) {
return (
<div className="testContent" />
);
return <div className="testContent" />;
}

@@ -131,7 +123,3 @@

it('does not render WeekNumbers component by default', () => {
const component = mount(
<MonthView
{...defaultProps}
/>,
);
const component = mount(<MonthView {...defaultProps} />);

@@ -142,8 +130,3 @@ expect(component.find('WeekNumbers')).toHaveLength(0);

it('renders WeekNumbers component by given showWeekNumbers flag', () => {
const component = mount(
<MonthView
{...defaultProps}
showWeekNumbers
/>,
);
const component = mount(<MonthView {...defaultProps} showWeekNumbers />);

@@ -156,8 +139,3 @@ expect(component.find('WeekNumbers')).toHaveLength(1);

const component = shallow(
<MonthView
{...defaultProps}
calendarType={calendarType}
/>,
);
const component = shallow(<MonthView {...defaultProps} calendarType={calendarType} />);

@@ -172,8 +150,3 @@ const weekdays = component.find('Weekdays');

const component = shallow(
<MonthView
{...defaultProps}
locale={locale}
/>,
);
const component = shallow(<MonthView {...defaultProps} locale={locale} />);

@@ -189,6 +162,3 @@ const weekdays = component.find('Weekdays');

const component = shallow(
<MonthView
{...defaultProps}
formatShortWeekday={formatShortWeekday}
/>,
<MonthView {...defaultProps} formatShortWeekday={formatShortWeekday} />,
);

@@ -204,8 +174,3 @@

const component = shallow(
<MonthView
{...defaultProps}
calendarType={calendarType}
/>,
);
const component = shallow(<MonthView {...defaultProps} calendarType={calendarType} />);

@@ -220,8 +185,3 @@ const days = component.find('Days');

const component = shallow(
<MonthView
{...defaultProps}
locale={locale}
/>,
);
const component = shallow(<MonthView {...defaultProps} locale={locale} />);

@@ -236,8 +196,3 @@ const days = component.find('Days');

const component = shallow(
<MonthView
{...defaultProps}
formatDay={formatDay}
/>,
);
const component = shallow(<MonthView {...defaultProps} formatDay={formatDay} />);

@@ -252,8 +207,3 @@ const days = component.find('Days');

const component = shallow(
<MonthView
{...defaultProps}
formatLongDate={formatLongDate}
/>,
);
const component = shallow(<MonthView {...defaultProps} formatLongDate={formatLongDate} />);

@@ -260,0 +210,0 @@ const days = component.find('Days');

@@ -6,4 +6,2 @@ import React from 'react';

/* eslint-disable jsx-a11y/mouse-events-have-key-events */
const tileProps = {

@@ -48,21 +46,13 @@ activeStartDate: new Date(2018, 0, 1),

it('applies additional classNames for neighboring months', () => {
const component = mount(
<Day
{...tileProps}
date={new Date(2018, 1, 2)}
/>,
);
const component = mount(<Day {...tileProps} date={new Date(2018, 1, 2)} />);
const wrapperClassName = component.find('.react-calendar__tile').prop('className');
expect(wrapperClassName.includes('react-calendar__month-view__days__day--neighboringMonth')).toBe(true);
expect(
wrapperClassName.includes('react-calendar__month-view__days__day--neighboringMonth'),
).toBe(true);
});
it('renders component with proper abbreviation', () => {
const component = mount(
<Day
{...tileProps}
date={new Date(2018, 0, 1)}
/>,
);
const component = mount(<Day {...tileProps} date={new Date(2018, 0, 1)} />);

@@ -76,9 +66,5 @@ const abbr = component.find('abbr');

it('is disabled when date is before beginning of minDate\'s day', () => {
it("is disabled when date is before beginning of minDate's day", () => {
const component = mount(
<Day
{...tileProps}
date={new Date(2018, 0, 1)}
minDate={new Date(2018, 0, 2)}
/>,
<Day {...tileProps} date={new Date(2018, 0, 1)} minDate={new Date(2018, 0, 2)} />,
);

@@ -89,9 +75,5 @@

it('is not disabled when date is after beginning of minDate\'s day', () => {
it("is not disabled when date is after beginning of minDate's day", () => {
const component = mount(
<Day
{...tileProps}
date={new Date(2018, 0, 1)}
minDate={new Date(2018, 0, 1)}
/>,
<Day {...tileProps} date={new Date(2018, 0, 1)} minDate={new Date(2018, 0, 1)} />,
);

@@ -102,9 +84,5 @@

it('is disabled when date is after end of maxDate\'s day', () => {
it("is disabled when date is after end of maxDate's day", () => {
const component = mount(
<Day
{...tileProps}
date={new Date(2018, 0, 2)}
maxDate={new Date(2018, 0, 1)}
/>,
<Day {...tileProps} date={new Date(2018, 0, 2)} maxDate={new Date(2018, 0, 1)} />,
);

@@ -115,9 +93,5 @@

it('is not disabled when date is before end of maxDate\'s day', () => {
it("is not disabled when date is before end of maxDate's day", () => {
const component = mount(
<Day
{...tileProps}
date={new Date(2018, 0, 1)}
maxDate={new Date(2018, 0, 1)}
/>,
<Day {...tileProps} date={new Date(2018, 0, 1)} maxDate={new Date(2018, 0, 1)} />,
);

@@ -132,9 +106,3 @@

const component = mount(
<Day
{...tileProps}
date={date}
onClick={onClick}
/>,
);
const component = mount(<Day {...tileProps} date={date} onClick={onClick} />);

@@ -151,9 +119,3 @@ component.find('.react-calendar__tile').simulate('click');

const component = mount(
<Day
{...tileProps}
date={date}
onMouseOver={onMouseOver}
/>,
);
const component = mount(<Day {...tileProps} date={date} onMouseOver={onMouseOver} />);

@@ -170,9 +132,3 @@ component.find('.react-calendar__tile').simulate('mouseOver');

const component = mount(
<Day
{...tileProps}
date={date}
onMouseOver={onMouseOver}
/>,
);
const component = mount(<Day {...tileProps} date={date} onMouseOver={onMouseOver} />);

@@ -186,8 +142,3 @@ component.find('.react-calendar__tile').simulate('focus');

it('renders tileContent properly', () => {
const component = mount(
<Day
{...tileProps}
tileContent={<div className="testContent" />}
/>,
);
const component = mount(<Day {...tileProps} tileContent={<div className="testContent" />} />);

@@ -204,9 +155,3 @@ const testContent = component.find('.testContent');

const component = mount(
<Day
{...tileProps}
date={date}
tileContent={tileContent}
/>,
);
const component = mount(<Day {...tileProps} date={date} tileContent={tileContent} />);

@@ -231,8 +176,3 @@ const testContent = component.find('.testContent');

const component = mount(
<Day
{...tileProps}
date={date}
formatDay={formatDay}
locale={locale}
/>,
<Day {...tileProps} date={date} formatDay={formatDay} locale={locale} />,
);

@@ -254,8 +194,3 @@

const component = mount(
<Day
{...tileProps}
date={date}
formatLongDate={formatLongDate}
locale={locale}
/>,
<Day {...tileProps} date={date} formatLongDate={formatLongDate} locale={locale} />,
);

@@ -262,0 +197,0 @@

import React from 'react';
import PropTypes from 'prop-types';
import {
getYear,
getMonth,
getDaysInMonth,
} from '@wojtekmaj/date-utils';
import { getYear, getMonth, getDaysInMonth } from '@wojtekmaj/date-utils';

@@ -16,11 +12,4 @@ import TileGroup from '../TileGroup';

export default function Days(props) {
const {
activeStartDate,
calendarType,
} = props;
const {
showFixedNumberOfWeeks,
showNeighboringMonth,
...otherProps
} = props;
const { activeStartDate, calendarType } = props;
const { showFixedNumberOfWeeks, showNeighboringMonth, ...otherProps } = props;

@@ -50,3 +39,3 @@ const year = getYear(activeStartDate);

// Always show 6 weeks
return start + (6 * 7) - 1;
return start + 6 * 7 - 1;
}

@@ -53,0 +42,0 @@

import React from 'react';
import PropTypes from 'prop-types';
import {
getYear,
getMonth,
getMonthStart,
} from '@wojtekmaj/date-utils';
import { getYear, getMonth, getMonthStart } from '@wojtekmaj/date-utils';

@@ -12,3 +8,6 @@ import Flex from '../Flex';

import { getDayOfWeek } from '../shared/dates';
import { formatWeekday, formatShortWeekday as defaultFormatShortWeekday } from '../shared/dateFormatter';
import {
formatWeekday,
formatShortWeekday as defaultFormatShortWeekday,
} from '../shared/dateFormatter';
import { isCalendarType } from '../shared/propTypes';

@@ -35,3 +34,5 @@

const weekdayDate = new Date(
year, monthIndex, weekday - getDayOfWeek(beginOfMonth, calendarType),
year,
monthIndex,
weekday - getDayOfWeek(beginOfMonth, calendarType),
);

@@ -42,6 +43,3 @@

weekdays.push(
<div
key={weekday}
className={`${className}__weekday`}
>
<div key={weekday} className={`${className}__weekday`}>
<abbr aria-label={abbr} title={abbr}>

@@ -55,8 +53,3 @@ {formatShortWeekday(locale, weekdayDate).replace('.', '')}

return (
<Flex
className={className}
count={7}
onFocus={onMouseLeave}
onMouseOver={onMouseLeave}
>
<Flex className={className} count={7} onFocus={onMouseLeave} onMouseOver={onMouseLeave}>
{weekdays}

@@ -63,0 +56,0 @@ </Flex>

@@ -12,8 +12,3 @@ import React from 'react';

it('renders proper weekdays (ISO 8601)', () => {
const component = mount(
<Weekdays
{...defaultProps}
calendarType="ISO 8601"
/>,
);
const component = mount(<Weekdays {...defaultProps} calendarType="ISO 8601" />);

@@ -30,8 +25,3 @@ const weekdays = component.find('.react-calendar__month-view__weekdays__weekday');

it('renders proper weekdays (US)', () => {
const component = mount(
<Weekdays
{...defaultProps}
calendarType="US"
/>,
);
const component = mount(<Weekdays {...defaultProps} calendarType="US" />);

@@ -48,8 +38,3 @@ const weekdays = component.find('.react-calendar__month-view__weekdays__weekday');

it('renders weekdays with custom weekdays formatting', () => {
const component = mount(
<Weekdays
{...defaultProps}
formatShortWeekday={() => 'Weekday'}
/>,
);
const component = mount(<Weekdays {...defaultProps} formatShortWeekday={() => 'Weekday'} />);

@@ -56,0 +41,0 @@ const weekdays = component.find('.react-calendar__month-view__weekdays__weekday');

@@ -6,8 +6,3 @@ import React from 'react';

export default function WeekNumber({
date,
onClickWeekNumber,
weekNumber,
...otherProps
}) {
export default function WeekNumber({ date, onClickWeekNumber, weekNumber, ...otherProps }) {
const props = {

@@ -18,24 +13,14 @@ className,

const children = (
<span>
{weekNumber}
</span>
);
const children = <span>{weekNumber}</span>;
return (
onClickWeekNumber
? (
<button
{...props}
onClick={(event) => onClickWeekNumber(weekNumber, date, event)}
type="button"
>
{children}
</button>
)
: (
<div {...props}>
{children}
</div>
)
return onClickWeekNumber ? (
<button
{...props}
onClick={(event) => onClickWeekNumber(weekNumber, date, event)}
type="button"
>
{children}
</button>
) : (
<div {...props}>{children}</div>
);

@@ -42,0 +27,0 @@ }

@@ -13,5 +13,3 @@ import React from 'react';

it('renders div by default', () => {
const component = shallow(
<WeekNumber {...defaultProps} />,
);
const component = shallow(<WeekNumber {...defaultProps} />);

@@ -25,6 +23,3 @@ expect(component.find('div')).toHaveLength(1);

const component = shallow(
<WeekNumber
{...defaultProps}
onClickWeekNumber={onClickWeekNumber}
/>,
<WeekNumber {...defaultProps} onClickWeekNumber={onClickWeekNumber} />,
);

@@ -38,8 +33,3 @@

const component = shallow(
<WeekNumber
{...defaultProps}
weekNumber={weekNumber}
/>,
);
const component = shallow(<WeekNumber {...defaultProps} weekNumber={weekNumber} />);

@@ -46,0 +36,0 @@ expect(component.text()).toBe(weekNumber);

import React from 'react';
import PropTypes from 'prop-types';
import {
getYear,
getMonth,
getDate,
getDaysInMonth,
} from '@wojtekmaj/date-utils';
import { getYear, getMonth, getDate, getDaysInMonth } from '@wojtekmaj/date-utils';

@@ -13,17 +8,8 @@ import WeekNumber from './WeekNumber';

import {
getBeginOfWeek,
getDayOfWeek,
getWeekNumber,
} from '../shared/dates';
import { getBeginOfWeek, getDayOfWeek, getWeekNumber } from '../shared/dates';
import { isCalendarType } from '../shared/propTypes';
export default function WeekNumbers(props) {
const {
activeStartDate,
calendarType,
onClickWeekNumber,
onMouseLeave,
showFixedNumberOfWeeks,
} = props;
const { activeStartDate, calendarType, onClickWeekNumber, onMouseLeave, showFixedNumberOfWeeks } =
props;

@@ -49,5 +35,3 @@ const numberOfWeeks = (() => {

for (let index = 0; index < numberOfWeeks; index += 1) {
result.push(
getBeginOfWeek(new Date(year, monthIndex, day + (index * 7)), calendarType),
);
result.push(getBeginOfWeek(new Date(year, monthIndex, day + index * 7), calendarType));
}

@@ -68,12 +52,10 @@ return result;

>
{
weekNumbers.map((weekNumber, weekIndex) => (
<WeekNumber
key={weekNumber}
date={dates[weekIndex]}
onClickWeekNumber={onClickWeekNumber}
weekNumber={weekNumber}
/>
))
}
{weekNumbers.map((weekNumber, weekIndex) => (
<WeekNumber
key={weekNumber}
date={dates[weekIndex]}
onClickWeekNumber={onClickWeekNumber}
weekNumber={weekNumber}
/>
))}
</Flex>

@@ -80,0 +62,0 @@ );

@@ -58,7 +58,3 @@ import React from 'react';

const component = mount(
<WeekNumbers
{...defaultProps}
activeStartDate={new Date(2017, 0, 1)}
calendarType="US"
/>,
<WeekNumbers {...defaultProps} activeStartDate={new Date(2017, 0, 1)} calendarType="US" />,
);

@@ -90,8 +86,3 @@

it('renders static divs as children when not given onClickWeekNumber', () => {
const component = mount(
<WeekNumbers
{...defaultProps}
calendarType="ISO 8601"
/>,
);
const component = mount(<WeekNumbers {...defaultProps} calendarType="ISO 8601" />);

@@ -105,7 +96,3 @@ const children = component.find('div.react-calendar__tile');

const component = mount(
<WeekNumbers
{...defaultProps}
calendarType="ISO 8601"
onClickWeekNumber={jest.fn()}
/>,
<WeekNumbers {...defaultProps} calendarType="ISO 8601" onClickWeekNumber={jest.fn()} />,
);

@@ -137,7 +124,3 @@

const component = mount(
<WeekNumbers
{...defaultProps}
calendarType="US"
onClickWeekNumber={onClickWeekNumber}
/>,
<WeekNumbers {...defaultProps} calendarType="US" onClickWeekNumber={onClickWeekNumber} />,
);

@@ -144,0 +127,0 @@

@@ -52,8 +52,5 @@ export const CALENDAR_TYPES = {

],
[CALENDAR_TYPES.HEBREW]: [
'he',
'he-IL',
],
[CALENDAR_TYPES.HEBREW]: ['he', 'he-IL'],
};
export const WEEKDAYS = [...Array(7)].map((el, index) => index);
import getUserLocale from 'get-user-locale';
const formatterCache = new Map();
function getFormatter(options) {
return (locale, date) => date.toLocaleString(locale || getUserLocale(), options);
return (locale, date) => {
const localeWithDefault = locale || getUserLocale();
if (!formatterCache.has(localeWithDefault)) {
formatterCache.set(localeWithDefault, new Map());
}
const formatterCacheLocale = formatterCache.get(localeWithDefault);
if (!formatterCacheLocale.has(options)) {
formatterCacheLocale.set(options, new Intl.DateTimeFormat(localeWithDefault, options).format);
}
return formatterCacheLocale.get(options)(date);
};
}

@@ -6,0 +22,0 @@

import {
getYear,
getMonth as getMonthIndex,
getCenturyStart,

@@ -11,3 +10,2 @@ getPreviousCenturyStart,

getCenturyRange,
getDecadeStart,

@@ -19,3 +17,2 @@ getPreviousDecadeStart,

getDecadeRange,
getYearStart,

@@ -27,3 +24,2 @@ getPreviousYearStart,

getYearRange,
getMonthStart,

@@ -35,3 +31,2 @@ getPreviousMonthStart,

getMonthRange,
getDayStart,

@@ -111,7 +106,4 @@ getDayEnd,

export function getWeekNumber(date, calendarType = CALENDAR_TYPES.ISO_8601) {
const calendarTypeForWeekNumber = (
calendarType === CALENDAR_TYPES.US
? CALENDAR_TYPES.US
: CALENDAR_TYPES.ISO_8601
);
const calendarTypeForWeekNumber =
calendarType === CALENDAR_TYPES.US ? CALENDAR_TYPES.US : CALENDAR_TYPES.ISO_8601;
const beginOfWeek = getBeginOfWeek(date, calendarType);

@@ -144,8 +136,14 @@ let year = getYear(date) + 1;

switch (rangeType) {
case 'century': return getCenturyStart(date);
case 'decade': return getDecadeStart(date);
case 'year': return getYearStart(date);
case 'month': return getMonthStart(date);
case 'day': return getDayStart(date);
default: throw new Error(`Invalid rangeType: ${rangeType}`);
case 'century':
return getCenturyStart(date);
case 'decade':
return getDecadeStart(date);
case 'year':
return getYearStart(date);
case 'month':
return getMonthStart(date);
case 'day':
return getDayStart(date);
default:
throw new Error(`Invalid rangeType: ${rangeType}`);
}

@@ -156,7 +154,12 @@ }

switch (rangeType) {
case 'century': return getPreviousCenturyStart(date);
case 'decade': return getPreviousDecadeStart(date);
case 'year': return getPreviousYearStart(date);
case 'month': return getPreviousMonthStart(date);
default: throw new Error(`Invalid rangeType: ${rangeType}`);
case 'century':
return getPreviousCenturyStart(date);
case 'decade':
return getPreviousDecadeStart(date);
case 'year':
return getPreviousYearStart(date);
case 'month':
return getPreviousMonthStart(date);
default:
throw new Error(`Invalid rangeType: ${rangeType}`);
}

@@ -167,7 +170,12 @@ }

switch (rangeType) {
case 'century': return getNextCenturyStart(date);
case 'decade': return getNextDecadeStart(date);
case 'year': return getNextYearStart(date);
case 'month': return getNextMonthStart(date);
default: throw new Error(`Invalid rangeType: ${rangeType}`);
case 'century':
return getNextCenturyStart(date);
case 'decade':
return getNextDecadeStart(date);
case 'year':
return getNextYearStart(date);
case 'month':
return getNextMonthStart(date);
default:
throw new Error(`Invalid rangeType: ${rangeType}`);
}

@@ -178,6 +186,10 @@ }

switch (rangeType) {
case 'decade': return getPreviousDecadeStart(date, -100);
case 'year': return getPreviousYearStart(date, -10);
case 'month': return getPreviousMonthStart(date, -12);
default: throw new Error(`Invalid rangeType: ${rangeType}`);
case 'decade':
return getPreviousDecadeStart(date, -100);
case 'year':
return getPreviousYearStart(date, -10);
case 'month':
return getPreviousMonthStart(date, -12);
default:
throw new Error(`Invalid rangeType: ${rangeType}`);
}

@@ -188,6 +200,10 @@ };

switch (rangeType) {
case 'decade': return getNextDecadeStart(date, 100);
case 'year': return getNextYearStart(date, 10);
case 'month': return getNextMonthStart(date, 12);
default: throw new Error(`Invalid rangeType: ${rangeType}`);
case 'decade':
return getNextDecadeStart(date, 100);
case 'year':
return getNextYearStart(date, 10);
case 'month':
return getNextMonthStart(date, 12);
default:
throw new Error(`Invalid rangeType: ${rangeType}`);
}

@@ -204,8 +220,14 @@ };

switch (rangeType) {
case 'century': return getCenturyEnd(date);
case 'decade': return getDecadeEnd(date);
case 'year': return getYearEnd(date);
case 'month': return getMonthEnd(date);
case 'day': return getDayEnd(date);
default: throw new Error(`Invalid rangeType: ${rangeType}`);
case 'century':
return getCenturyEnd(date);
case 'decade':
return getDecadeEnd(date);
case 'year':
return getYearEnd(date);
case 'month':
return getMonthEnd(date);
case 'day':
return getDayEnd(date);
default:
throw new Error(`Invalid rangeType: ${rangeType}`);
}

@@ -216,7 +238,12 @@ }

switch (rangeType) {
case 'century': return getPreviousCenturyEnd(date);
case 'decade': return getPreviousDecadeEnd(date);
case 'year': return getPreviousYearEnd(date);
case 'month': return getPreviousMonthEnd(date);
default: throw new Error(`Invalid rangeType: ${rangeType}`);
case 'century':
return getPreviousCenturyEnd(date);
case 'decade':
return getPreviousDecadeEnd(date);
case 'year':
return getPreviousYearEnd(date);
case 'month':
return getPreviousMonthEnd(date);
default:
throw new Error(`Invalid rangeType: ${rangeType}`);
}

@@ -227,6 +254,10 @@ }

switch (rangeType) {
case 'decade': return getPreviousDecadeEnd(date, -100);
case 'year': return getPreviousYearEnd(date, -10);
case 'month': return getPreviousMonthEnd(date, -12);
default: throw new Error(`Invalid rangeType: ${rangeType}`);
case 'decade':
return getPreviousDecadeEnd(date, -100);
case 'year':
return getPreviousYearEnd(date, -10);
case 'month':
return getPreviousMonthEnd(date, -12);
default:
throw new Error(`Invalid rangeType: ${rangeType}`);
}

@@ -243,8 +274,14 @@ };

switch (rangeType) {
case 'century': return getCenturyRange(date);
case 'decade': return getDecadeRange(date);
case 'year': return getYearRange(date);
case 'month': return getMonthRange(date);
case 'day': return getDayRange(date);
default: throw new Error(`Invalid rangeType: ${rangeType}`);
case 'century':
return getCenturyRange(date);
case 'decade':
return getDecadeRange(date);
case 'year':
return getYearRange(date);
case 'month':
return getMonthRange(date);
case 'day':
return getDayRange(date);
default:
throw new Error(`Invalid rangeType: ${rangeType}`);
}

@@ -262,12 +299,7 @@ }

const rawNextValue = [date1, date2].sort((a, b) => a - b);
return [
getBegin(rangeType, rawNextValue[0]),
getEnd(rangeType, rawNextValue[1]),
];
return [getBegin(rangeType, rawNextValue[0]), getEnd(rangeType, rawNextValue[1])];
}
function toYearLabel(locale, formatYear = defaultFormatYear, dates) {
return dates
.map((date) => formatYear(locale, date))
.join(' – ');
return dates.map((date) => formatYear(locale, date)).join(' – ');
}

@@ -274,0 +306,0 @@

@@ -835,5 +835,3 @@ import { getDayStart, getDayEnd } from '@wojtekmaj/date-utils';

${new Date(2017, 0, 2)} | ${false}
`('returns $flag for $date', ({
date, flag,
}) => {
`('returns $flag for $date', ({ date, flag }) => {
expect(isWeekend(date, 'ISO 8601')).toBe(flag);

@@ -850,5 +848,3 @@ });

${new Date(2017, 0, 2)} | ${false}
`('returns $flag for $date', ({
date, flag,
}) => {
`('returns $flag for $date', ({ date, flag }) => {
expect(isWeekend(date, 'US')).toBe(flag);

@@ -865,5 +861,3 @@ });

${new Date(2017, 0, 2)} | ${false}
`('returns $flag for $date', ({
date, flag,
}) => {
`('returns $flag for $date', ({ date, flag }) => {
expect(isWeekend(date, 'Arabic')).toBe(flag);

@@ -880,5 +874,3 @@ });

${new Date(2017, 0, 2)} | ${false}
`('returns $flag for $date', ({
date, flag,
}) => {
`('returns $flag for $date', ({ date, flag }) => {
expect(isWeekend(date, 'Hebrew')).toBe(flag);

@@ -895,5 +887,3 @@ });

${new Date(2017, 0, 2)} | ${false}
`('returns $flag for $date', ({
date, flag,
}) => {
`('returns $flag for $date', ({ date, flag }) => {
expect(isWeekend(date)).toBe(flag);

@@ -900,0 +890,0 @@ });

@@ -23,3 +23,5 @@ import PropTypes from 'prop-types';

if (!(minDate instanceof Date)) {
return new Error(`Invalid prop \`${propName}\` of type \`${typeof minDate}\` supplied to \`${componentName}\`, expected instance of \`Date\`.`);
return new Error(
`Invalid prop \`${propName}\` of type \`${typeof minDate}\` supplied to \`${componentName}\`, expected instance of \`Date\`.`,
);
}

@@ -30,3 +32,5 @@

if (maxDate && minDate > maxDate) {
return new Error(`Invalid prop \`${propName}\` of type \`${typeof minDate}\` supplied to \`${componentName}\`, minDate cannot be larger than maxDate.`);
return new Error(
`Invalid prop \`${propName}\` of type \`${typeof minDate}\` supplied to \`${componentName}\`, minDate cannot be larger than maxDate.`,
);
}

@@ -45,3 +49,5 @@

if (!(maxDate instanceof Date)) {
return new Error(`Invalid prop \`${propName}\` of type \`${typeof maxDate}\` supplied to \`${componentName}\`, expected instance of \`Date\`.`);
return new Error(
`Invalid prop \`${propName}\` of type \`${typeof maxDate}\` supplied to \`${componentName}\`, expected instance of \`Date\`.`,
);
}

@@ -52,3 +58,5 @@

if (minDate && maxDate < minDate) {
return new Error(`Invalid prop \`${propName}\` of type \`${typeof maxDate}\` supplied to \`${componentName}\`, maxDate cannot be smaller than minDate.`);
return new Error(
`Invalid prop \`${propName}\` of type \`${typeof maxDate}\` supplied to \`${componentName}\`, maxDate cannot be smaller than minDate.`,
);
}

@@ -62,3 +70,2 @@

PropTypes.shape({
// eslint-disable-next-line react/forbid-prop-types
current: PropTypes.any,

@@ -82,3 +89,7 @@ }),

if (view !== undefined && allowedViews.indexOf(view) === -1) {
return new Error(`Invalid prop \`${propName}\` of value \`${view}\` supplied to \`${componentName}\`, expected one of [${allowedViews.map((a) => `"${a}"`).join(', ')}].`);
return new Error(
`Invalid prop \`${propName}\` of value \`${view}\` supplied to \`${componentName}\`, expected one of [${allowedViews
.map((a) => `"${a}"`)
.join(', ')}].`,
);
}

@@ -94,3 +105,5 @@

if (!view) {
return new Error(`The prop \`${propName}\` is marked as required in \`${componentName}\`, but its value is \`${view}\`.`);
return new Error(
`The prop \`${propName}\` is marked as required in \`${componentName}\`, but its value is \`${view}\`.`,
);
}

@@ -109,10 +122,4 @@

onMouseOver: PropTypes.func,
tileClassName: PropTypes.oneOfType([
PropTypes.func,
isClassName,
]),
tileContent: PropTypes.oneOfType([
PropTypes.func,
PropTypes.node,
]),
tileClassName: PropTypes.oneOfType([PropTypes.func, isClassName]),
tileContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
value: isValue,

@@ -131,15 +138,6 @@ valueType: PropTypes.string,

onMouseOver: PropTypes.func,
style: PropTypes.objectOf(PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
])),
tileClassName: PropTypes.oneOfType([
PropTypes.func,
isClassName,
]),
tileContent: PropTypes.oneOfType([
PropTypes.func,
PropTypes.node,
]),
style: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
tileClassName: PropTypes.oneOfType([PropTypes.func, isClassName]),
tileContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
tileDisabled: PropTypes.func,
};

@@ -21,20 +21,11 @@ import { getRange } from './dates';

export function isValueWithinRange(value, range) {
return (
range[0] <= value
&& range[1] >= value
);
return range[0] <= value && range[1] >= value;
}
export function isRangeWithinRange(greaterRange, smallerRange) {
return (
greaterRange[0] <= smallerRange[0]
&& greaterRange[1] >= smallerRange[1]
);
return greaterRange[0] <= smallerRange[0] && greaterRange[1] >= smallerRange[1];
}
export function doRangesOverlap(range1, range2) {
return (
isValueWithinRange(range1[0], range2)
|| isValueWithinRange(range1[1], range2)
);
return isValueWithinRange(range1[0], range2) || isValueWithinRange(range1[1], range2);
}

@@ -69,5 +60,3 @@

export function getTileClasses({
value, valueType, date, dateType, hover,
} = {}) {
export function getTileClasses({ value, valueType, date, dateType, hover } = {}) {
const className = 'react-calendar__tile';

@@ -81,3 +70,5 @@ const classes = [className];

if (!Array.isArray(date) && !dateType) {
throw new Error('getTileClasses(): Unable to get tile activity classes because one or more required arguments were not passed.');
throw new Error(
'getTileClasses(): Unable to get tile activity classes because one or more required arguments were not passed.',
);
}

@@ -97,3 +88,5 @@

if (!Array.isArray(value) && !valueType) {
throw new Error('getTileClasses(): Unable to get tile activity classes because one or more required arguments were not passed.');
throw new Error(
'getTileClasses(): Unable to get tile activity classes because one or more required arguments were not passed.',
);
}

@@ -100,0 +93,0 @@

@@ -175,10 +175,8 @@ import {

it('throws an error when given date but not given dateType parameter ', () => {
expect(
() => getTileClasses({ date: new Date(2017, 0, 1) }),
).toThrow();
expect(() => getTileClasses({ date: new Date(2017, 0, 1) })).toThrow();
});
it('throws an error when given date and value but not given valueType parameter ', () => {
expect(
() => getTileClasses({
expect(() =>
getTileClasses({
date: new Date(2017, 0, 1),

@@ -185,0 +183,0 @@ dateType: 'month',

@@ -7,8 +7,14 @@ import React, { Component } from 'react';

function datesAreDifferent(date1, date2) {
return (
(date1 && !date2) ||
(!date1 && date2) ||
(date1 && date2 && date1.getTime() !== date2.getTime())
);
}
function getValue(nextProps, prop) {
const { activeStartDate, date, view } = nextProps;
return typeof prop === 'function'
? prop({ activeStartDate, date, view })
: prop;
return typeof prop === 'function' ? prop({ activeStartDate, date, view }) : prop;
}

@@ -18,7 +24,10 @@

static getDerivedStateFromProps(nextProps, prevState) {
const { tileClassName, tileContent } = nextProps;
const { activeStartDate, tileClassName, tileContent } = nextProps;
const nextState = {};
if (tileClassName !== prevState.tileClassNameProps) {
if (
tileClassName !== prevState.tileClassNameProps ||
datesAreDifferent(activeStartDate, prevState.activeStartDateProps)
) {
nextState.tileClassName = getValue(nextProps, tileClassName);

@@ -28,3 +37,6 @@ nextState.tileClassNameProps = tileClassName;

if (tileContent !== prevState.tileContentProps) {
if (
tileContent !== prevState.tileContentProps ||
datesAreDifferent(activeStartDate, prevState.activeStartDateProps)
) {
nextState.tileContent = getValue(nextProps, tileContent);

@@ -34,2 +46,4 @@ nextState.tileContentProps = tileContent;

nextState.activeStartDateProps = activeStartDate;
return nextState;

@@ -64,5 +78,5 @@ }

disabled={
(minDate && minDateTransform(minDate) > date)
|| (maxDate && maxDateTransform(maxDate) < date)
|| (tileDisabled && tileDisabled({ activeStartDate, date, view }))
(minDate && minDateTransform(minDate) > date) ||
(maxDate && maxDateTransform(maxDate) < date) ||
(tileDisabled && tileDisabled({ activeStartDate, date, view }))
}

@@ -75,9 +89,3 @@ onClick={onClick && ((event) => onClick(date, event))}

>
{formatAbbr
? (
<abbr aria-label={formatAbbr(locale, date)}>
{children}
</abbr>
)
: children}
{formatAbbr ? <abbr aria-label={formatAbbr(locale, date)}>{children}</abbr> : children}
{tileContent}

@@ -84,0 +92,0 @@ </button>

@@ -17,5 +17,3 @@ import React from 'react';

it('renders button properly', () => {
const component = shallow(
<Tile {...defaultProps} />,
);
const component = shallow(<Tile {...defaultProps} />);

@@ -28,8 +26,3 @@ expect(component.find('button')).toHaveLength(1);

const component = shallow(
<Tile
{...defaultProps}
onClick={onClick}
/>,
);
const component = shallow(<Tile {...defaultProps} onClick={onClick} />);

@@ -46,8 +39,3 @@ const button = component.find('button');

const component = shallow(
<Tile
{...defaultProps}
classes={classes}
/>,
);
const component = shallow(<Tile {...defaultProps} classes={classes} />);

@@ -64,7 +52,3 @@ const button = component.find('button');

const component = shallow(
<Tile {...defaultProps}>
{children}
</Tile>,
);
const component = shallow(<Tile {...defaultProps}>{children}</Tile>);

@@ -75,5 +59,3 @@ expect(component.text()).toBe(children);

it('does not render abbr by default', () => {
const component = shallow(
<Tile {...defaultProps} />,
);
const component = shallow(<Tile {...defaultProps} />);

@@ -88,10 +70,3 @@ expect(component.find('abbr')).toHaveLength(0);

shallow(
<Tile
{...defaultProps}
date={date}
formatAbbr={formatAbbr}
locale={locale}
/>,
);
shallow(<Tile {...defaultProps} date={date} formatAbbr={formatAbbr} locale={locale} />);

@@ -108,6 +83,3 @@ expect(formatAbbr).toHaveBeenCalledTimes(1);

const component = shallow(
<Tile
{...defaultProps}
formatAbbr={formatAbbr}
>
<Tile {...defaultProps} formatAbbr={formatAbbr}>
{children}

@@ -157,8 +129,3 @@ </Tile>,

const component = shallow(
<Tile
{...defaultProps}
tileClassName={tileClassName}
/>,
);
const component = shallow(<Tile {...defaultProps} tileClassName={tileClassName} />);

@@ -173,8 +140,3 @@ const button = component.find('button');

const component = shallow(
<Tile
{...defaultProps}
tileClassName={className}
/>,
);
const component = shallow(<Tile {...defaultProps} tileClassName={className} />);

@@ -219,8 +181,3 @@ const button = component.find('button');

const component = shallow(
<Tile
{...defaultProps}
tileContent={tileContent}
/>,
);
const component = shallow(<Tile {...defaultProps} tileContent={tileContent} />);

@@ -235,8 +192,3 @@ const button = component.find('button');

const component = shallow(
<Tile
{...defaultProps}
tileContent={content}
/>,
);
const component = shallow(<Tile {...defaultProps} tileContent={content} />);

@@ -275,8 +227,3 @@ const button = component.find('button');

const component = shallow(
<Tile
{...defaultProps}
tileDisabled={tileDisabled}
/>,
);
const component = shallow(<Tile {...defaultProps} tileDisabled={tileDisabled} />);

@@ -283,0 +230,0 @@ const button = component.find('button');

@@ -32,3 +32,7 @@ import React from 'react';

classes={getTileClasses({
value, valueType, date, dateType, hover,
value,
valueType,
date,
dateType,
hover,
})}

@@ -43,8 +47,3 @@ date={date}

return (
<Flex
className={className}
count={count}
offset={offset}
wrap
>
<Flex className={className} count={count} offset={offset} wrap>
{tiles}

@@ -51,0 +50,0 @@ </Flex>

@@ -7,12 +7,6 @@ import React from 'react';

function renderMonths() {
return (
<Months {...props} />
);
return <Months {...props} />;
}
return (
<div className="react-calendar__year-view">
{renderMonths()}
</div>
);
return <div className="react-calendar__year-view">{renderMonths()}</div>;
}

@@ -16,7 +16,3 @@ import React from 'react';

const component = mount(
<YearView
{...defaultProps}
activeStartDate={activeStartDate}
showNeighboringMonth={false}
/>,
<YearView {...defaultProps} activeStartDate={activeStartDate} showNeighboringMonth={false} />,
);

@@ -33,7 +29,3 @@

const component = mount(
<YearView
{...defaultProps}
showNeighboringMonth={false}
tileClassName={tileClassName}
/>,
<YearView {...defaultProps} showNeighboringMonth={false} tileClassName={tileClassName} />,
);

@@ -77,11 +69,5 @@

it('renders tileContent in its tiles when given a node', () => {
const tileContent = (
<div className="testContent" />
);
const tileContent = <div className="testContent" />;
const component = mount(
<YearView
{...defaultProps}
showNeighboringMonth={false}
tileContent={tileContent}
/>,
<YearView {...defaultProps} showNeighboringMonth={false} tileContent={tileContent} />,
);

@@ -101,5 +87,3 @@

if (date.getTime() === activeStartDate.getTime()) {
return (
<div className="testContent" />
);
return <div className="testContent" />;
}

@@ -130,8 +114,3 @@

it('displays year view with custom month formatting', () => {
const component = mount(
<YearView
{...defaultProps}
formatMonth={() => 'Month'}
/>,
);
const component = mount(<YearView {...defaultProps} formatMonth={() => 'Month'} />);

@@ -146,8 +125,3 @@ const month = component.find('.react-calendar__year-view__months__month').first();

const component = shallow(
<YearView
{...defaultProps}
formatMonth={formatMonth}
/>,
);
const component = shallow(<YearView {...defaultProps} formatMonth={formatMonth} />);

@@ -154,0 +128,0 @@ const months = component.find('Months');

@@ -6,4 +6,2 @@ import React from 'react';

/* eslint-disable jsx-a11y/mouse-events-have-key-events */
const tileProps = {

@@ -34,9 +32,3 @@ activeStartDate: new Date(2018, 0, 1),

it('renders component with proper abbreviation', () => {
const component = mount(
<Month
{...tileProps}
date={new Date(2018, 0, 1)}
month={2018}
/>,
);
const component = mount(<Month {...tileProps} date={new Date(2018, 0, 1)} month={2018} />);

@@ -50,9 +42,5 @@ const abbr = component.find('abbr');

it('is disabled when date is before beginning of minDate\'s month', () => {
it("is disabled when date is before beginning of minDate's month", () => {
const component = mount(
<Month
{...tileProps}
date={new Date(2018, 6, 1)}
minDate={new Date(2018, 7, 1)}
/>,
<Month {...tileProps} date={new Date(2018, 6, 1)} minDate={new Date(2018, 7, 1)} />,
);

@@ -63,9 +51,5 @@

it('is not disabled when date is after beginning of minDate\'s month', () => {
it("is not disabled when date is after beginning of minDate's month", () => {
const component = mount(
<Month
{...tileProps}
date={new Date(2018, 0, 1)}
minDate={new Date(2018, 0, 1)}
/>,
<Month {...tileProps} date={new Date(2018, 0, 1)} minDate={new Date(2018, 0, 1)} />,
);

@@ -76,9 +60,5 @@

it('is disabled when date is after end of maxDate\'s month', () => {
it("is disabled when date is after end of maxDate's month", () => {
const component = mount(
<Month
{...tileProps}
date={new Date(2018, 6, 1)}
maxDate={new Date(2018, 5, 1)}
/>,
<Month {...tileProps} date={new Date(2018, 6, 1)} maxDate={new Date(2018, 5, 1)} />,
);

@@ -89,9 +69,5 @@

it('is not disabled when date is before end of maxDate\'s month', () => {
it("is not disabled when date is before end of maxDate's month", () => {
const component = mount(
<Month
{...tileProps}
date={new Date(2018, 0, 1)}
maxDate={new Date(2018, 0, 1)}
/>,
<Month {...tileProps} date={new Date(2018, 0, 1)} maxDate={new Date(2018, 0, 1)} />,
);

@@ -106,9 +82,3 @@

const component = mount(
<Month
{...tileProps}
date={date}
onClick={onClick}
/>,
);
const component = mount(<Month {...tileProps} date={date} onClick={onClick} />);

@@ -125,9 +95,3 @@ component.find('.react-calendar__tile').simulate('click');

const component = mount(
<Month
{...tileProps}
date={date}
onMouseOver={onMouseOver}
/>,
);
const component = mount(<Month {...tileProps} date={date} onMouseOver={onMouseOver} />);

@@ -144,9 +108,3 @@ component.find('.react-calendar__tile').simulate('mouseOver');

const component = mount(
<Month
{...tileProps}
date={date}
onMouseOver={onMouseOver}
/>,
);
const component = mount(<Month {...tileProps} date={date} onMouseOver={onMouseOver} />);

@@ -160,8 +118,3 @@ component.find('.react-calendar__tile').simulate('focus');

it('renders tileContent properly', () => {
const component = mount(
<Month
{...tileProps}
tileContent={<div className="testContent" />}
/>,
);
const component = mount(<Month {...tileProps} tileContent={<div className="testContent" />} />);

@@ -178,9 +131,3 @@ const testContent = component.find('.testContent');

const component = mount(
<Month
{...tileProps}
date={date}
tileContent={tileContent}
/>,
);
const component = mount(<Month {...tileProps} date={date} tileContent={tileContent} />);

@@ -205,8 +152,3 @@ const testContent = component.find('.testContent');

const component = mount(
<Month
{...tileProps}
date={date}
formatMonth={formatMonth}
locale={locale}
/>,
<Month {...tileProps} date={date} formatMonth={formatMonth} locale={locale} />,
);

@@ -228,8 +170,3 @@

const component = mount(
<Month
{...tileProps}
date={date}
formatMonthYear={formatMonthYear}
locale={locale}
/>,
<Month {...tileProps} date={date} formatMonthYear={formatMonthYear} locale={locale} />,
);

@@ -236,0 +173,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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