Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
rc-year-calendar
Advanced tools
Official wrapper for the year-calendar widget. https://year-calendar.github.io/
You can get the widget using the following methods:
npm install rc-year-calendar
yarn add rc-year-calendar
<script src="https://unpkg.com/rc-year-calendar@latest/dist/rc-year-calendar.umd.min.js"></script>
AND
<link rel="stylesheet" type="text/css" href="https://unpkg.com/rc-year-calendar@latest/dist/rc-year-calendar.min.css" />
You can create a calendar using the following javascript code :
// Import
import Calendar from 'rc-year-calendar';
import 'rc-year-calendar/dist/rc-year-calendar.css';
// Render
render() {
return (<Calendar />);
}
You can specify props to customize the calendar:
render() {
return (
<Calendar style="background" minDate={new Date()} />
);
}
The props are the following
Option name | Description | Type | Default value |
---|---|---|---|
allowOverlap | Specifies whether the user can select a range which overlapping an other element present in the datasource. | boolean | true |
alwaysHalfDay | Specifies whether the beginning and the end of each range should be displayed as half selected day. | boolean | false |
contextMenuItems | Specifies the items of the default context menu. | array | [] |
customDayRenderer | Specify a custom renderer for data source. Works only with the style set to "custom". This function is called duringender for each day containing at least one event. | Render function | null |
customDataSourceRenderer | Specify a custom renderer for days. This function is called during render for each day. | Render function | null |
dataSource | The elements that must be displayed on the calendar. | array or function | [] |
disabledDays | The days that must be displayed as disabled. | array | [] |
disabledWeekDays | The days of the week that must be displayed as disabled (0 for Sunday, 1 for Monday, etc.). | array | [] |
displayDisabledDataSource | Specifies whether the data source must be rendered on disabled days. | boolean | false |
displayHeader | Specifies whether the calendar header is displayed. | boolean | true |
displayWeekNumber | Specifies whether the weeks number are displayed. | boolean | false |
enableContextMenu | Specifies whether the default context menu must be displayed when right clicking on a day. | boolean | false |
enableRangeSelection | Specifies whether the range selection is enabled. | boolean | false |
hiddenWeekDays | The days of the week that must not be displayed (0 for Sunday, 1 for Monday, etc.). | array | [] |
language | The language/culture used for calendar rendering. | String | en |
loadingTemplate | A custom loading template | String | null |
maxDate | The date until which days are enabled. | Date | null |
minDate | The date from which days are enabled. | Date | null |
roundRangeLimits | Specifies whether the beginning and the end of each range should be displayed as rounded cells. | boolean | false |
style | Specifies the style used for displaying datasource ("background", "border" or "custom"). | string | border |
weekStart | The starting day of the week. This option overrides the parameter define in the language file. | number | 0 |
year | The year displayed by the calendar. | number | Current year |
defaultYear | The year on which the calendar should be opened. | number | Current year |
Event name | Description | Parameter |
---|---|---|
onDayClick | Function fired when a day is clicked. | { date, events } |
onDayContextMenu | Function fired when a day is right clicked. | { date, events } |
onDayEnter | Function fired when the mouse enter on a day. | { date, events } |
onDayLeave | Function fired when the mouse leaves a day. | { date, events } |
renderEnd | Function fired when the calendar rendering is ended. | { currentYear } |
onRangeSelected | Function fired when a date range is selected. | { startDate, endDate } |
onYearChanged | Function fired when the visible year of the calendar is changed. | { currentYear } |
Check the examples page to discover all the functionalities.
FAQs
Official react wrapper for the year-calendar widget
The npm package rc-year-calendar receives a total of 1,347 weekly downloads. As such, rc-year-calendar popularity was classified as popular.
We found that rc-year-calendar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.