
Security News
pnpm 10.12 Introduces Global Virtual Store and Expanded Version Catalogs
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
react-plain-calendar
Advanced tools
React Calendar Component
npm i -S react-plain-calendar
The plugin ships with a default styling available at this location in the installed package:
node_modules/react-plain-calendar/lib/styles.css
You will need Webpack or other build system, that supports requiring css files.
import React, { Component } from 'react';
import Calendar from 'react-plain-calendar';
import 'react-plain-calendar/lib/styles.css';
export default class AwesomeComponent extends Component {
onDateSelect(date) {
/* do something */
}
render() {
return (
<div>
<Calendar onDateSelect={this.onDateSelect} />
</div>
)
}
}
theme - Object of CSS classes with the following keys.
locale - The locale (by default is used "window.navigator.language" or "en" if not defined).
startOfWeek - First day of week. It must be a number from 0 (sunday) to 6 (saturday) (by default "0").
activeDate - Date with active state (by default is current date).
prevLabel - Label on a button "previous". Can be a string or React element (by default "〈").
nextLabel - Label on a button "next". Can be a string or React element (by default "〉").
renderYearEntry, renderMonthEntry, renderDateEntry - You can rewrite default render methods
renderEntry(label, date, onSelect, options)
onSelect
method with date
as a parameter when entry selected.theme
, isOutside
, isActive
parameters.By default method look as:
(label, date, onSelect, { theme, isOutside, isActive }) => (
<button
className={isOutside ? theme.gridDateOutside
: isActive ? theme.gridDateActive : theme.gridDate}
onClick={() => onSelect(date)}
>
{label}
</button>
)
onDateSelect - A callback which is triggered whenever the entry is selected.
onDateSelect(date)
onSelectDate
→ onDateSelect
prevLabel
and nextLabel
props.Install all dependencies, then start the demo
$ npm install
$ npm start
Don't forget about tests
$ npm test
You can automatically format code by standard code style
$ npm run fix
Please, create issues and pull requests.
MIT.
FAQs
React Calendar Component
The npm package react-plain-calendar receives a total of 1 weekly downloads. As such, react-plain-calendar popularity was classified as not popular.
We found that react-plain-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
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
Security News
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.