Created
January 10, 2018 20:17
-
-
Save ehahn9/69f1a20b9edbe675b85ea0f148954377 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import BigCalendar from 'react-big-calendar'; | |
class BigCalendarTimeslotsTest extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { timeslots: 2 }; | |
} | |
render() { | |
const { timeslots } = this.state; | |
const step = 60 / timeslots; | |
return ( | |
<div> | |
<div> | |
<p style={{ fontSize: '24pt' }}> | |
<input | |
style={{ width: '3em', textAlign: 'center' }} | |
type="number" | |
value={timeslots} | |
min={1} max={20} | |
onChange={e => this.setState({ timeslots: parseInt(e.target.value) })} /> | |
<span>step = {step}</span> | |
</p> | |
</div> | |
<div style={{ height: '400px' }}> | |
<BigCalendar defaultView="week" events={[]} timeslots={timeslots} step={step} /> | |
</div> | |
</div> | |
); | |
} | |
} | |
export default BigCalendarTimeslotsTest; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment