2.1.0 • Published 7 years ago
react-awesome-date v2.1.0
React-awesome-date

Installation
via NPM
npm i react-awesome-datevia Yarn
yarn add react-awesome-datevia CDN (unpkg)
https://unpkg.com/react-awesome-date@latest/dest/react-awesome-date.jsBe sure to include the style sheet. It is located in the /styles folder. You must use two css files. One for calendar styles, and one for the styles user interface
import "react-awesome-date/styles/index.css"
import "react-awesome-date/styles/ui_default.css"Or
<link rel="stylesheet" href="https://unpkg.com/react-awesome-date@latest/index.css">
<link rel="stylesheet" href="https://unpkg.com/react-awesome-date@latest/ui_default.css">Usage
import Date from 'react-awesome-date';
<Date year={1998} month={3} />By default, the date will be inserted for the current month and year
<Date />Event
Get the selected date using onSelect
function onSelect(date){
// ...
}
<Date onSelect={onSelect}/>Custom render
Organize your own rendering or use ready-made samples
import {headerRenderer as input} from 'react-awesome-date/ui/input';
import "react-awesome-date/styles/ui_input.css";
<Date headerRenderer={input}/>The result is 
import {headerRenderer as onlymonth} from 'react-awesome-date/ui/onlymonth';
import "react-awesome-date/styles/ui_onlymonth.css";
<Date headerRenderer={onlymonth}/>The result is 