1.4.3 • Published 5 years ago

react-universal-calendar v1.4.3

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

react-universal-calendar


NPM version

React universal calendar

Fully customizable calendar

Install

npm i react-universal-calendar

// or if using yarn
yarn add react-universal-calendar

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import UniversalCalendar from "react-universal-calendar"

const Calendar = () =>
    <UniversalCalendar renderHeader={() => <div>Custom calendar</div>}
                       renderDate={(date) => <div>{date.format("D")}</div>}/>

ReactDOM.render(<Calendar/>, document.getElementById('root'));

Props

initDate

Type: moment

Month of date determines start page of calendar.

renderHeader

Type: func

Function for render header of calendar.

renderSwitchMonth

Type: function

Function for render navigation component. It has 3 arguments.

  • date - moment of current month
  • swipeLeft - function for switching to previous month
  • swipeRight - function for switching to next month
renderSwitchMonth: (date, swipeLeft, swipeRight) => {/*  your component   */}

dateAreaStyle

Type: object

Additional styles applied for calendar dates container.

renderDayOfWeekName

Type: function

Function for render cell with week day name. It has 1 argument:

  • dayNum - serial number of the day of the week.
renderDayOfWeekName: (dayNum) => {/*  your component   */}

cellStyle

Type: object

Additional styles applied for date container.

renderDate

Type: function

Function for render cell with date. It has 2 argument:

  • date - moment of current date.
  • currentMonth - moment of current month.
 renderDate: (date, currentMonth) => ({/*  your component   */}

License

License

1.4.3

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago