This package has been deprecated

Author message:

This package moved to [@the-/ui-calendar](https://www.npmjs.com/package/@the-/ui-calendar)

the-calendar

1.0.21 • Public • Published

the-calendar

Build Status npm Version JS Standard

Calendar of the-components

Installation

$ npm install the-calendar --save

Usage

'use strict'
 
import React from 'react'
import { TheCalendar, TheCalendarStyle } from 'the-calendar'
import { TheButtonStyle } from 'the-button'
 
const events = [
  {
    id: 1,
    node: <span>This is event01</span>,
    start: new Date(),
    end: new Date(new Date().getTime() + 60 * 60 * 1000),
    onSelect: (event) => {
      console.log('event01 selected!', event)
    }
  },
 
  {
    id: 2,
    node: <span>This is event02</span>,
    start: new Date(new Date().getTime() + 24 * 60 * 60 * 1000),
    end: new Date(new Date().getTime() + 25 * 60 * 60 * 1000),
    onSelect: (event) => {
      console.log('event02 selected!', event)
    }
  }
]
 
class ExampleComponent extends React.Component {
  constructor (props) {
    super(props)
    this.state = {
      view: 'month',
      date: new Date(),
    }
  }
 
  render () {
    return (
      <div>
        <TheButtonStyle/>
        <TheCalendarStyle/>
        <TheCalendar onNavigate={(date) => this.setState({ date })}
                     onView={(view) => this.setState({ view })}
                     date={this.state.date}
                     view={this.state.view}
                     events={events}
        >
        </TheCalendar>
      </div>
 
    )
  }
}
 
export default ExampleComponent
 

Components

TheCalendar

Calendar of the-components

Props

Name Type Description Default
date object Showing date object ``
events arrayOf object Events to show []
lang string Lang 'en'
onNavigate func Navigate to date null
onView func Change view null
view string View of calendar 'month'
views arrayOf string ['month', 'day']
toolbar false

TheCalendarStyle

Style for TheCalendar

Props

Name Type Description Default
options object Style options {}

License

This software is released under the MIT License.

Links

Readme

Keywords

Package Sidebar

Install

npm i the-calendar

Weekly Downloads

0

Version

1.0.21

License

MIT

Unpacked Size

8.28 MB

Total Files

32

Last publish

Collaborators

  • okunishinishi