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

react-calendar

Package Overview
Dependencies
Maintainers
2
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 1.0.2 to 1.0.3

5

demo.js

@@ -58,2 +58,7 @@ import moment from 'moment';

{
date: moment().add(3, 'days'),
classNames: [ 'appointment' ],
component: [ 'day' ]
},
{
date: moment().add(4, 'days'),

@@ -60,0 +65,0 @@ classNames: [ 'event', 'warning' ],

53

dist/react-calendar.js

@@ -180,4 +180,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

'header',
{ key: 'header',
className: (0, _classnames2.default)('rc-Calendar-header') },
{ key: 'header', className: (0, _classnames2.default)('rc-Calendar-header') },
this.moment(this.props.date).format(this.props.yearHeaderFormat)

@@ -214,9 +213,2 @@ );

this.getMonthRange().map(function (date, i) {
var fWeekMods = weekMods.filter(function (mod, j) {
return mod.date ? mod.date.get('month') === i : true;
});
var fDayMods = dayMods.filter(function (mod, k) {
return mod.date ? mod.date.get('month') === i : true;
});
return _react2.default.createElement(_Month2.default, { key: 'month-' + i,

@@ -226,4 +218,4 @@ date: date,

mods: monthMods,
week: fWeekMods,
day: fDayMods });
week: weekMods,
day: dayMods });
})

@@ -346,5 +338,19 @@ );

var getModByDate = function getModByDate(mods, date, type) {
return mods.find(function (mod) {
var modifier = {
date: null,
classNames: [],
events: {}
};
mods.filter(function (mod) {
return mod.date ? mod.date.isSame(date, type) : null;
}).forEach(function (_mod) {
var _modifier$classNames;
modifier.date = _mod.date;
modifier.events = Object.assign(modifier.events, _mod.events);
(_modifier$classNames = modifier.classNames).push.apply(_modifier$classNames, _toConsumableArray(_mod.classNames));
});
return modifier;
};

@@ -475,2 +481,9 @@

var fWeekMods = week.filter(function (mod, j) {
return mod.date ? mod.date.isSame(date, 'month') : true;
});
var fDayMods = day.filter(function (mod, k) {
return mod.date ? mod.date.isSame(date, 'month') : true;
});
var modifiers = (0, _util.getMods)(mods, date, clsPrefix, 'month');

@@ -493,4 +506,4 @@

weekNumbers: weekNumbers,
mods: week,
day: day });
mods: fWeekMods,
day: fDayMods });
})

@@ -629,4 +642,3 @@ );

'div',
{ key: 'weekNumber',
className: (0, _classnames2.default)(clsPrefix + '-number') },
{ key: 'weekNumber', className: (0, _classnames2.default)(clsPrefix + '-number') },
props.date.format(props.weekNumberFormat)

@@ -639,8 +651,8 @@ );

var date = props.date;
var clsMods = void 0;var events = void 0;var week = void 0;var day = props.day;
var modifiers = (0, _util.getMods)(mods, date, clsPrefix, 'week');
var clsMods = void 0;var events = void 0;var day = props.day;
week = (0, _util.getModsByCompType)('week', mods);
var modifiers = (0, _util.getMods)(week, date, clsPrefix, 'week');
if (modifiers) {

@@ -734,4 +746,3 @@ clsMods = modifiers.clsMods;

'div',
{ key: 'agenda',
className: clsPrefix + '-Day-agenda' },
{ key: 'agenda', className: clsPrefix + '-Day-agenda' },
props.children

@@ -738,0 +749,0 @@ );

{
"name": "react-calendar",
"version": "1.0.2",
"version": "1.0.3",
"author": "Mikhail <freiksenet@gmail.com> Novikov",

@@ -5,0 +5,0 @@ "description": "Calendar component for ReactJS",

@@ -37,4 +37,3 @@ import React, { Component, PropTypes } from 'react';

return (
<header key="header"
className={classnames('rc-Calendar-header')}>
<header key="header" className={classnames('rc-Calendar-header')}>
{ this.moment(this.props.date).format(this.props.yearHeaderFormat) }

@@ -64,13 +63,10 @@ </header>

{
this.getMonthRange().map((date, i) => {
let fWeekMods = weekMods.filter((mod, j) => mod.date ? mod.date.get('month') === i : true);
let fDayMods = dayMods.filter((mod, k) => mod.date ? mod.date.get('month') === i : true);
return <Month key={ `month-${i}` }
date={ date }
weekNumbers={ this.props.weekNumbers }
mods={ monthMods }
week={ fWeekMods }
day={ fDayMods } />
})
this.getMonthRange().map((date, i) =>
<Month key={ `month-${i}` }
date={ date }
weekNumbers={ this.props.weekNumbers }
mods={ monthMods }
week={ weekMods }
day={ dayMods } />
)
}

@@ -77,0 +73,0 @@ </div>

@@ -26,4 +26,3 @@ import React, { PropTypes } from 'react';

return (
<div key="agenda"
className={`${clsPrefix}-Day-agenda`}>
<div key="agenda" className={`${clsPrefix}-Day-agenda`}>
{ props.children }

@@ -30,0 +29,0 @@ </div>

@@ -56,2 +56,5 @@ import React, { PropTypes } from 'react';

let fWeekMods = week.filter((mod, j) => mod.date ? mod.date.isSame(date, 'month') : true);
let fDayMods = day.filter((mod, k) => mod.date ? mod.date.isSame(date, 'month') : true);
const modifiers = getMods(mods, date, clsPrefix, 'month');

@@ -74,4 +77,4 @@

weekNumbers={ weekNumbers }
mods={ week }
day={ day } />
mods={ fWeekMods }
day={ fDayMods } />
)

@@ -78,0 +81,0 @@ }

@@ -13,5 +13,19 @@ const bindEvents = (events, date) => {

const getModByDate = (mods, date, type) =>
mods.find((mod) => mod.date ? mod.date.isSame(date, type) : null);
const getModByDate = (mods, date, type) => {
const modifier = {
date: null,
classNames: [],
events: {}
};
mods.filter((mod) => mod.date ? mod.date.isSame(date, type) : null)
.forEach((_mod) => {
modifier.date = _mod.date;
modifier.events = Object.assign(modifier.events, _mod.events);
modifier.classNames.push(..._mod.classNames);
});
return modifier;
}
const getModsWithoutDate = (mods) =>

@@ -18,0 +32,0 @@ mods.filter((mod) => !mod.date)

@@ -16,4 +16,3 @@ import React, { PropTypes } from 'react';

return (
<div key="weekNumber"
className={ classnames(`${clsPrefix}-number`) }>
<div key="weekNumber" className={ classnames(`${clsPrefix}-number`) }>
{ props.date.format(props.weekNumberFormat) }

@@ -26,5 +25,6 @@ </div>

const { mods, date } = props;
const modifiers = getMods(mods, date, clsPrefix, 'week');
let clsMods, events, week, { day } = props;
let clsMods, events, { day } = props;
week = getModsByCompType('week', mods);
const modifiers = getMods(week, date, clsPrefix, 'week');

@@ -31,0 +31,0 @@ if (modifiers) {

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