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

rc-year-calendar

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-year-calendar

Official react wrapper for the year-calendar widget

  • 1.0.0-alpha.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8K
decreased by-5.75%
Maintainers
1
Weekly downloads
 
Created
Source

rc-year-calendar

Official wrapper for the year-calendar widget. https://year-calendar.github.io/

alt tag

Installation

You can get the widget using the following methods:

  • From the GitHub repository
  • From the Node package manager, using the following command: npm install rc-year-calendar
  • From Yarn, using the following command: yarn add rc-year-calendar
  • From the CDN, by adding the following script directly in your HTML page:

<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" />

Usage

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 />);
}

Using options

You can specify props to customize the calendar:

render() {
    return (
        <Calendar style="background" minDate={new Date()} />
    );
}

The props are the following

Option nameDescriptionTypeDefault value
allowOverlapSpecifies whether the user can select a range which overlapping an other element present in the datasource.booleantrue
alwaysHalfDaySpecifies whether the beginning and the end of each range should be displayed as half selected day.booleanfalse
contextMenuItemsSpecifies the items of the default context menu.array[]
customDayRendererSpecify 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 functionnull
customDataSourceRendererSpecify a custom renderer for days. This function is called during render for each day.Render functionnull
dataSourceThe elements that must be displayed on the calendar.array or function[]
disabledDaysThe days that must be displayed as disabled.array[]
disabledWeekDaysThe days of the week that must be displayed as disabled (0 for Sunday, 1 for Monday, etc.).array[]
displayDisabledDataSourceSpecifies whether the data source must be rendered on disabled days.booleanfalse
displayHeaderSpecifies whether the calendar header is displayed.booleantrue
displayWeekNumberSpecifies whether the weeks number are displayed.booleanfalse
enableContextMenuSpecifies whether the default context menu must be displayed when right clicking on a day.booleanfalse
enableRangeSelectionSpecifies whether the range selection is enabled.booleanfalse
hiddenWeekDaysThe days of the week that must not be displayed (0 for Sunday, 1 for Monday, etc.).array[]
languageThe language/culture used for calendar rendering.Stringen
loadingTemplateA custom loading templateStringnull
maxDateThe date until which days are enabled.Datenull
minDateThe date from which days are enabled.Datenull
roundRangeLimitsSpecifies whether the beginning and the end of each range should be displayed as rounded cells.booleanfalse
styleSpecifies the style used for displaying datasource ("background", "border" or "custom").stringborder
weekStartThe starting day of the week. This option overrides the parameter define in the language file.number0
yearThe year displayed by the calendar.numberCurrent year
defaultYearThe year on which the calendar should be opened.numberCurrent year
Event nameDescriptionParameter
onDayClickFunction fired when a day is clicked.{ date, events }
onDayContextMenuFunction fired when a day is right clicked.{ date, events }
onDayEnterFunction fired when the mouse enter on a day.{ date, events }
onDayLeaveFunction fired when the mouse leaves a day.{ date, events }
renderEndFunction fired when the calendar rendering is ended.{ currentYear }
onRangeSelectedFunction fired when a date range is selected.{ startDate, endDate }
onYearChangedFunction fired when the visible year of the calendar is changed.{ currentYear }

What next

Check the examples page to discover all the functionalities.

Keywords

FAQs

Package last updated on 14 Mar 2019

Did you know?

Socket

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.

Install

Related posts

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