react-calendar
Advanced tools
Comparing version 3.3.1 to 3.4.0
@@ -537,2 +537,3 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
var _this$props6 = this.props, | ||
formatDay = _this$props6.formatDay, | ||
formatLongDate = _this$props6.formatLongDate, | ||
@@ -548,2 +549,3 @@ formatShortWeekday = _this$props6.formatShortWeekday, | ||
calendarType: calendarType, | ||
formatDay: formatDay, | ||
formatLongDate: formatLongDate, | ||
@@ -727,2 +729,3 @@ formatShortWeekday: formatShortWeekday, | ||
defaultView: isView, | ||
formatDay: PropTypes.func, | ||
formatLongDate: PropTypes.func, | ||
@@ -729,0 +732,0 @@ formatMonth: PropTypes.func, |
@@ -9,2 +9,3 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
import PropTypes from 'prop-types'; | ||
import mergeClassNames from 'merge-class-names'; | ||
import Days from './MonthView/Days'; | ||
@@ -66,3 +67,3 @@ import Weekdays from './MonthView/Weekdays'; | ||
return /*#__PURE__*/React.createElement("div", { | ||
className: [className, showWeekNumbers ? "".concat(className, "--weekNumbers") : ''].join(' ') | ||
className: mergeClassNames(className, showWeekNumbers ? "".concat(className, "--weekNumbers") : '') | ||
}, /*#__PURE__*/React.createElement("div", { | ||
@@ -69,0 +70,0 @@ style: { |
@@ -15,10 +15,12 @@ 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; } | ||
import PropTypes from 'prop-types'; | ||
import { getDate, getDayStart, getDayEnd } from '@wojtekmaj/date-utils'; | ||
import { getDayStart, getDayEnd } from '@wojtekmaj/date-utils'; | ||
import Tile from '../Tile'; | ||
import { isWeekend } from '../shared/dates'; | ||
import { formatLongDate as defaultFormatLongDate } from '../shared/dateFormatter'; | ||
import { formatDay as defaultFormatDay, formatLongDate as defaultFormatLongDate } from '../shared/dateFormatter'; | ||
import { tileProps } from '../shared/propTypes'; | ||
var className = 'react-calendar__month-view__days__day'; | ||
export default function Day(_ref) { | ||
var _ref$formatLongDate = _ref.formatLongDate, | ||
var _ref$formatDay = _ref.formatDay, | ||
formatDay = _ref$formatDay === void 0 ? defaultFormatDay : _ref$formatDay, | ||
_ref$formatLongDate = _ref.formatLongDate, | ||
formatLongDate = _ref$formatLongDate === void 0 ? defaultFormatLongDate : _ref$formatLongDate, | ||
@@ -28,5 +30,6 @@ calendarType = _ref.calendarType, | ||
currentMonthIndex = _ref.currentMonthIndex, | ||
otherProps = _objectWithoutProperties(_ref, ["formatLongDate", "calendarType", "classes", "currentMonthIndex"]); | ||
otherProps = _objectWithoutProperties(_ref, ["formatDay", "formatLongDate", "calendarType", "classes", "currentMonthIndex"]); | ||
var date = otherProps.date; | ||
var date = otherProps.date, | ||
locale = otherProps.locale; | ||
return /*#__PURE__*/React.createElement(Tile, _extends({}, otherProps, { | ||
@@ -38,7 +41,8 @@ classes: [].concat(classes, className, isWeekend(date, calendarType) ? "".concat(className, "--weekend") : null, date.getMonth() !== currentMonthIndex ? "".concat(className, "--neighboringMonth") : null), | ||
view: "month" | ||
}), getDate(date)); | ||
}), formatDay(locale, date)); | ||
} | ||
Day.propTypes = _objectSpread(_objectSpread({}, tileProps), {}, { | ||
currentMonthIndex: PropTypes.number.isRequired, | ||
formatDay: PropTypes.func, | ||
formatLongDate: PropTypes.func | ||
}); |
@@ -35,2 +35,5 @@ import getUserLocale from 'get-user-locale'; | ||
}; | ||
var formatDayOptions = { | ||
day: 'numeric' | ||
}; | ||
var formatLongDateOptions = { | ||
@@ -48,5 +51,2 @@ day: 'numeric', | ||
}; | ||
var formatYearOptions = { | ||
year: 'numeric' | ||
}; | ||
var formatShortWeekdayOptions = { | ||
@@ -58,8 +58,12 @@ weekday: 'short' | ||
}; | ||
var formatYearOptions = { | ||
year: 'numeric' | ||
}; | ||
export var formatDate = getSafeFormatter(formatDateOptions); | ||
export var formatDay = getSafeFormatter(formatDayOptions); | ||
export var formatLongDate = getSafeFormatter(formatLongDateOptions); | ||
export var formatMonth = getSafeFormatter(formatMonthOptions); | ||
export var formatMonthYear = getSafeFormatter(formatMonthYearOptions); | ||
export var formatYear = getSafeFormatter(formatYearOptions); | ||
export var formatShortWeekday = getSafeFormatter(formatShortWeekdayOptions); | ||
export var formatWeekday = getSafeFormatter(formatWeekdayOptions); | ||
export var formatWeekday = getSafeFormatter(formatWeekdayOptions); | ||
export var formatYear = getSafeFormatter(formatYearOptions); |
@@ -53,3 +53,3 @@ import { getYear, getMonth as getMonthIndex, getCenturyStart, getPreviousCenturyStart, getNextCenturyStart, getCenturyEnd, getPreviousCenturyEnd, getCenturyRange, getDecadeStart, getPreviousDecadeStart, getNextDecadeStart, getDecadeEnd, getPreviousDecadeEnd, getDecadeRange, getYearStart, getPreviousYearStart, getNextYearStart, getYearEnd, getPreviousYearEnd, getYearRange, getMonthStart, getPreviousMonthStart, getNextMonthStart, getMonthEnd, getPreviousMonthEnd, getMonthRange, getDayStart, getDayEnd, getDayRange } from '@wojtekmaj/date-utils'; | ||
* @param {Date} date Date. | ||
* @param {String} calendarType Calendar type. Can be ISO 8601 or US. | ||
* @param {string} calendarType Calendar type. Can be ISO 8601 or US. | ||
*/ | ||
@@ -70,3 +70,3 @@ | ||
* @param {Date} date Date. | ||
* @param {String} calendarType Calendar type. Can be ISO 8601 or US. | ||
* @param {string} calendarType Calendar type. Can be ISO 8601 or US. | ||
*/ | ||
@@ -97,3 +97,3 @@ | ||
* | ||
* @param {String} rangeType Range type (e.g. 'day') | ||
* @param {string} rangeType Range type (e.g. 'day') | ||
* @param {Date} date Date. | ||
@@ -192,3 +192,3 @@ */ | ||
* | ||
* @param {String} rangeType Range type (e.g. 'day') | ||
* @param {string} rangeType Range type (e.g. 'day') | ||
* @param {Date} date Date. | ||
@@ -254,3 +254,3 @@ */ | ||
* | ||
* @param {String} rangeType Range type (e.g. 'day') | ||
* @param {string} rangeType Range type (e.g. 'day') | ||
* @param {Date} date Date. | ||
@@ -283,3 +283,3 @@ */ | ||
* | ||
* @param {String} rangeType Range type (e.g. 'day') | ||
* @param {string} rangeType Range type (e.g. 'day') | ||
* @param {Date} date1 First date. | ||
@@ -286,0 +286,0 @@ * @param {Date} date2 Second date. |
@@ -64,2 +64,3 @@ 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; } | ||
dateTransform: PropTypes.func.isRequired, | ||
dateType: PropTypes.string, | ||
offset: PropTypes.number, | ||
@@ -66,0 +67,0 @@ step: PropTypes.number, |
@@ -561,2 +561,3 @@ "use strict"; | ||
var _this$props6 = this.props, | ||
formatDay = _this$props6.formatDay, | ||
formatLongDate = _this$props6.formatLongDate, | ||
@@ -572,2 +573,3 @@ formatShortWeekday = _this$props6.formatShortWeekday, | ||
calendarType: calendarType, | ||
formatDay: formatDay, | ||
formatLongDate: formatLongDate, | ||
@@ -754,2 +756,3 @@ formatShortWeekday: formatShortWeekday, | ||
defaultView: _propTypes2.isView, | ||
formatDay: _propTypes["default"].func, | ||
formatLongDate: _propTypes["default"].func, | ||
@@ -756,0 +759,0 @@ formatMonth: _propTypes["default"].func, |
@@ -12,2 +12,4 @@ "use strict"; | ||
var _mergeClassNames = _interopRequireDefault(require("merge-class-names")); | ||
var _Days = _interopRequireDefault(require("./MonthView/Days")); | ||
@@ -81,3 +83,3 @@ | ||
return /*#__PURE__*/_react["default"].createElement("div", { | ||
className: [className, showWeekNumbers ? "".concat(className, "--weekNumbers") : ''].join(' ') | ||
className: (0, _mergeClassNames["default"])(className, showWeekNumbers ? "".concat(className, "--weekNumbers") : '') | ||
}, /*#__PURE__*/_react["default"].createElement("div", { | ||
@@ -84,0 +86,0 @@ style: { |
@@ -39,3 +39,5 @@ "use strict"; | ||
function Day(_ref) { | ||
var _ref$formatLongDate = _ref.formatLongDate, | ||
var _ref$formatDay = _ref.formatDay, | ||
formatDay = _ref$formatDay === void 0 ? _dateFormatter.formatDay : _ref$formatDay, | ||
_ref$formatLongDate = _ref.formatLongDate, | ||
formatLongDate = _ref$formatLongDate === void 0 ? _dateFormatter.formatLongDate : _ref$formatLongDate, | ||
@@ -45,5 +47,6 @@ calendarType = _ref.calendarType, | ||
currentMonthIndex = _ref.currentMonthIndex, | ||
otherProps = _objectWithoutProperties(_ref, ["formatLongDate", "calendarType", "classes", "currentMonthIndex"]); | ||
otherProps = _objectWithoutProperties(_ref, ["formatDay", "formatLongDate", "calendarType", "classes", "currentMonthIndex"]); | ||
var date = otherProps.date; | ||
var date = otherProps.date, | ||
locale = otherProps.locale; | ||
return /*#__PURE__*/_react["default"].createElement(_Tile["default"], _extends({}, otherProps, { | ||
@@ -55,3 +58,3 @@ classes: [].concat(classes, className, (0, _dates.isWeekend)(date, calendarType) ? "".concat(className, "--weekend") : null, date.getMonth() !== currentMonthIndex ? "".concat(className, "--neighboringMonth") : null), | ||
view: "month" | ||
}), (0, _dateUtils.getDate)(date)); | ||
}), formatDay(locale, date)); | ||
} | ||
@@ -61,3 +64,4 @@ | ||
currentMonthIndex: _propTypes["default"].number.isRequired, | ||
formatDay: _propTypes["default"].func, | ||
formatLongDate: _propTypes["default"].func | ||
}); |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.formatWeekday = exports.formatShortWeekday = exports.formatYear = exports.formatMonthYear = exports.formatMonth = exports.formatLongDate = exports.formatDate = void 0; | ||
exports.formatYear = exports.formatWeekday = exports.formatShortWeekday = exports.formatMonthYear = exports.formatMonth = exports.formatLongDate = exports.formatDay = exports.formatDate = void 0; | ||
@@ -45,2 +45,5 @@ var _getUserLocale = _interopRequireDefault(require("get-user-locale")); | ||
}; | ||
var formatDayOptions = { | ||
day: 'numeric' | ||
}; | ||
var formatLongDateOptions = { | ||
@@ -58,5 +61,2 @@ day: 'numeric', | ||
}; | ||
var formatYearOptions = { | ||
year: 'numeric' | ||
}; | ||
var formatShortWeekdayOptions = { | ||
@@ -68,4 +68,9 @@ weekday: 'short' | ||
}; | ||
var formatYearOptions = { | ||
year: 'numeric' | ||
}; | ||
var formatDate = getSafeFormatter(formatDateOptions); | ||
exports.formatDate = formatDate; | ||
var formatDay = getSafeFormatter(formatDayOptions); | ||
exports.formatDay = formatDay; | ||
var formatLongDate = getSafeFormatter(formatLongDateOptions); | ||
@@ -77,7 +82,7 @@ exports.formatLongDate = formatLongDate; | ||
exports.formatMonthYear = formatMonthYear; | ||
var formatYear = getSafeFormatter(formatYearOptions); | ||
exports.formatYear = formatYear; | ||
var formatShortWeekday = getSafeFormatter(formatShortWeekdayOptions); | ||
exports.formatShortWeekday = formatShortWeekday; | ||
var formatWeekday = getSafeFormatter(formatWeekdayOptions); | ||
exports.formatWeekday = formatWeekday; | ||
exports.formatWeekday = formatWeekday; | ||
var formatYear = getSafeFormatter(formatYearOptions); | ||
exports.formatYear = formatYear; |
@@ -80,3 +80,3 @@ "use strict"; | ||
* @param {Date} date Date. | ||
* @param {String} calendarType Calendar type. Can be ISO 8601 or US. | ||
* @param {string} calendarType Calendar type. Can be ISO 8601 or US. | ||
*/ | ||
@@ -98,3 +98,3 @@ | ||
* @param {Date} date Date. | ||
* @param {String} calendarType Calendar type. Can be ISO 8601 or US. | ||
* @param {string} calendarType Calendar type. Can be ISO 8601 or US. | ||
*/ | ||
@@ -126,3 +126,3 @@ | ||
* | ||
* @param {String} rangeType Range type (e.g. 'day') | ||
* @param {string} rangeType Range type (e.g. 'day') | ||
* @param {Date} date Date. | ||
@@ -228,3 +228,3 @@ */ | ||
* | ||
* @param {String} rangeType Range type (e.g. 'day') | ||
* @param {string} rangeType Range type (e.g. 'day') | ||
* @param {Date} date Date. | ||
@@ -295,3 +295,3 @@ */ | ||
* | ||
* @param {String} rangeType Range type (e.g. 'day') | ||
* @param {string} rangeType Range type (e.g. 'day') | ||
* @param {Date} date Date. | ||
@@ -327,3 +327,3 @@ */ | ||
* | ||
* @param {String} rangeType Range type (e.g. 'day') | ||
* @param {string} rangeType Range type (e.g. 'day') | ||
* @param {Date} date1 First date. | ||
@@ -330,0 +330,0 @@ * @param {Date} date2 Second date. |
@@ -79,2 +79,3 @@ "use strict"; | ||
dateTransform: _propTypes["default"].func.isRequired, | ||
dateType: _propTypes["default"].string, | ||
offset: _propTypes["default"].number, | ||
@@ -81,0 +82,0 @@ step: _propTypes["default"].number, |
{ | ||
"name": "react-calendar", | ||
"version": "3.3.1", | ||
"version": "3.4.0", | ||
"description": "Ultimate calendar for your React app.", | ||
@@ -90,3 +90,3 @@ "main": "dist/umd/index.js", | ||
"@babel/preset-react": "^7.9.0", | ||
"@wojtekmaj/enzyme-adapter-react-17": "^0.3.1", | ||
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.0", | ||
"babel-eslint": "^10.0.0", | ||
@@ -97,3 +97,3 @@ "enzyme": "^3.10.0", | ||
"jest": "^26.6.0", | ||
"less": "^3.8.1", | ||
"less": "^4.0.0", | ||
"react": "^17.0.0", | ||
@@ -107,2 +107,6 @@ "react-dom": "^17.0.0", | ||
}, | ||
"resolutions": { | ||
"rimraf@2.6.3": "^2.6.3", | ||
"semver@7.0.0": "^7.0.0" | ||
}, | ||
"files": [ | ||
@@ -109,0 +113,0 @@ "LICENSE", |
@@ -98,3 +98,4 @@ [![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) ![dependencies](https://img.shields.io/david/wojtekmaj/react-calendar.svg) ![dev dependencies](https://img.shields.io/david/dev/wojtekmaj/react-calendar.svg) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest) | ||
|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"`| | ||
|formatLongDate|Function called to override default formatting of day tiles. Can be used to use your own formatting function.|(default formatter)|`(locale, date) => formatDate(date, 'dd MMM YYYY')`| | ||
|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')`| | ||
@@ -178,3 +179,3 @@ |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')`| | ||
<a href="mailto:kontakt@wojtekmaj.pl">kontakt@wojtekmaj.pl</a><br /> | ||
<a href="http://wojtekmaj.pl">http://wojtekmaj.pl</a> | ||
<a href="https://wojtekmaj.pl">https://wojtekmaj.pl</a> | ||
</td> | ||
@@ -181,0 +182,0 @@ </tr> |
@@ -526,2 +526,3 @@ import React, { Component } from 'react'; | ||
const { | ||
formatDay, | ||
formatLongDate, | ||
@@ -540,2 +541,3 @@ formatShortWeekday, | ||
calendarType={calendarType} | ||
formatDay={formatDay} | ||
formatLongDate={formatLongDate} | ||
@@ -669,2 +671,3 @@ formatShortWeekday={formatShortWeekday} | ||
defaultView: isView, | ||
formatDay: PropTypes.func, | ||
formatLongDate: PropTypes.func, | ||
@@ -671,0 +674,0 @@ formatMonth: PropTypes.func, |
@@ -930,2 +930,15 @@ import React from 'react'; | ||
it('passes formatDay to MonthView component', () => { | ||
const formatDay = () => 'Day'; | ||
const component = shallow( | ||
<Calendar | ||
formatDay={formatDay} | ||
/>, | ||
); | ||
const monthView = component.find('MonthView'); | ||
expect(monthView.prop('formatDay')).toBe(formatDay); | ||
}); | ||
it('passes formatLongDate to MonthView component', () => { | ||
@@ -932,0 +945,0 @@ const formatLongDate = () => 'Long date'; |
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import mergeClassNames from 'merge-class-names'; | ||
@@ -74,6 +75,3 @@ import Days from './MonthView/Days'; | ||
<div | ||
className={[ | ||
className, | ||
showWeekNumbers ? `${className}--weekNumbers` : '', | ||
].join(' ')} | ||
className={mergeClassNames(className, showWeekNumbers ? `${className}--weekNumbers` : '')} | ||
> | ||
@@ -80,0 +78,0 @@ <div |
@@ -222,2 +222,17 @@ import React from 'react'; | ||
it('passes formatDay flag to Days component', () => { | ||
const formatDay = () => 'Day'; | ||
const component = shallow( | ||
<MonthView | ||
{...defaultProps} | ||
formatDay={formatDay} | ||
/>, | ||
); | ||
const days = component.find('Days'); | ||
expect(days.prop('formatDay')).toBe(formatDay); | ||
}); | ||
it('passes formatLongDate flag to Days component', () => { | ||
@@ -224,0 +239,0 @@ const formatLongDate = () => 'Long date'; |
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { getDate, getDayStart, getDayEnd } from '@wojtekmaj/date-utils'; | ||
import { getDayStart, getDayEnd } from '@wojtekmaj/date-utils'; | ||
@@ -8,3 +8,6 @@ import Tile from '../Tile'; | ||
import { isWeekend } from '../shared/dates'; | ||
import { formatLongDate as defaultFormatLongDate } from '../shared/dateFormatter'; | ||
import { | ||
formatDay as defaultFormatDay, | ||
formatLongDate as defaultFormatLongDate, | ||
} from '../shared/dateFormatter'; | ||
import { tileProps } from '../shared/propTypes'; | ||
@@ -15,2 +18,3 @@ | ||
export default function Day({ | ||
formatDay = defaultFormatDay, | ||
formatLongDate = defaultFormatLongDate, | ||
@@ -22,3 +26,3 @@ calendarType, | ||
}) { | ||
const { date } = otherProps; | ||
const { date, locale } = otherProps; | ||
@@ -39,3 +43,3 @@ return ( | ||
> | ||
{getDate(date)} | ||
{formatDay(locale, date)} | ||
</Tile> | ||
@@ -48,3 +52,4 @@ ); | ||
currentMonthIndex: PropTypes.number.isRequired, | ||
formatDay: PropTypes.func, | ||
formatLongDate: PropTypes.func, | ||
}; |
@@ -213,2 +213,24 @@ import React from 'react'; | ||
it('uses formatDay if given', () => { | ||
const locale = 'en-US'; | ||
const date = new Date(2018, 0, 1); | ||
const formatDay = jest.fn(); | ||
formatDay.mockReturnValue('Mock format'); | ||
const component = mount( | ||
<Day | ||
{...tileProps} | ||
date={date} | ||
formatDay={formatDay} | ||
locale={locale} | ||
/>, | ||
); | ||
const tile = component.find('Tile'); | ||
expect(formatDay).toHaveBeenCalled(); | ||
expect(formatDay).toHaveBeenCalledWith(locale, date); | ||
expect(tile.text()).toBe('Mock format'); | ||
}); | ||
it('uses formatLongDate if given', () => { | ||
@@ -215,0 +237,0 @@ const locale = 'en-US'; |
@@ -26,15 +26,17 @@ import getUserLocale from 'get-user-locale'; | ||
const formatDateOptions = { day: 'numeric', month: 'numeric', year: 'numeric' }; | ||
const formatDayOptions = { day: 'numeric' }; | ||
const formatLongDateOptions = { day: 'numeric', month: 'long', year: 'numeric' }; | ||
const formatMonthOptions = { month: 'long' }; | ||
const formatMonthYearOptions = { month: 'long', year: 'numeric' }; | ||
const formatYearOptions = { year: 'numeric' }; | ||
const formatShortWeekdayOptions = { weekday: 'short' }; | ||
const formatWeekdayOptions = { weekday: 'long' }; | ||
const formatYearOptions = { year: 'numeric' }; | ||
export const formatDate = getSafeFormatter(formatDateOptions); | ||
export const formatDay = getSafeFormatter(formatDayOptions); | ||
export const formatLongDate = getSafeFormatter(formatLongDateOptions); | ||
export const formatMonth = getSafeFormatter(formatMonthOptions); | ||
export const formatMonthYear = getSafeFormatter(formatMonthYearOptions); | ||
export const formatYear = getSafeFormatter(formatYearOptions); | ||
export const formatShortWeekday = getSafeFormatter(formatShortWeekdayOptions); | ||
export const formatWeekday = getSafeFormatter(formatWeekdayOptions); | ||
export const formatYear = getSafeFormatter(formatYearOptions); |
@@ -89,3 +89,3 @@ import { | ||
* @param {Date} date Date. | ||
* @param {String} calendarType Calendar type. Can be ISO 8601 or US. | ||
* @param {string} calendarType Calendar type. Can be ISO 8601 or US. | ||
*/ | ||
@@ -105,3 +105,3 @@ export function getBeginOfWeek(date, calendarType = CALENDAR_TYPES.ISO_8601) { | ||
* @param {Date} date Date. | ||
* @param {String} calendarType Calendar type. Can be ISO 8601 or US. | ||
* @param {string} calendarType Calendar type. Can be ISO 8601 or US. | ||
*/ | ||
@@ -136,3 +136,3 @@ export function getWeekNumber(date, calendarType = CALENDAR_TYPES.ISO_8601) { | ||
* | ||
* @param {String} rangeType Range type (e.g. 'day') | ||
* @param {string} rangeType Range type (e.g. 'day') | ||
* @param {Date} date Date. | ||
@@ -192,3 +192,3 @@ */ | ||
* | ||
* @param {String} rangeType Range type (e.g. 'day') | ||
* @param {string} rangeType Range type (e.g. 'day') | ||
* @param {Date} date Date. | ||
@@ -229,3 +229,3 @@ */ | ||
* | ||
* @param {String} rangeType Range type (e.g. 'day') | ||
* @param {string} rangeType Range type (e.g. 'day') | ||
* @param {Date} date Date. | ||
@@ -247,3 +247,3 @@ */ | ||
* | ||
* @param {String} rangeType Range type (e.g. 'day') | ||
* @param {string} rangeType Range type (e.g. 'day') | ||
* @param {Date} date1 First date. | ||
@@ -250,0 +250,0 @@ * @param {Date} date2 Second date. |
@@ -78,3 +78,3 @@ import { getRange } from './dates'; | ||
if (!(Array.isArray(date)) && !dateType) { | ||
if (!Array.isArray(date) && !dateType) { | ||
throw new Error('getTileClasses(): Unable to get tile activity classes because one or more required arguments were not passed.'); | ||
@@ -94,3 +94,3 @@ } | ||
if (!(Array.isArray(value)) && !valueType) { | ||
if (!Array.isArray(value) && !valueType) { | ||
throw new Error('getTileClasses(): Unable to get tile activity classes because one or more required arguments were not passed.'); | ||
@@ -97,0 +97,0 @@ } |
@@ -58,2 +58,3 @@ import React from 'react'; | ||
dateTransform: PropTypes.func.isRequired, | ||
dateType: PropTypes.string, | ||
offset: PropTypes.number, | ||
@@ -60,0 +61,0 @@ step: PropTypes.number, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
468294
10797
202