1.0.21 • Published 5 years ago

the-calendar v1.0.21

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

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

NameTypeDescriptionDefault
dateobjectShowing date object
eventsarrayOf objectEvents to show[]
langstringLang'en'
onNavigatefuncNavigate to datenull
onViewfuncChange viewnull
viewstringView of calendar'month'
viewsarrayOf string['month', 'day']
toolbarfalse

TheCalendarStyle

Style for TheCalendar

Props

NameTypeDescriptionDefault
optionsobjectStyle options{}

License

This software is released under the MIT License.

Links

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago