1.0.3 • Published 5 years ago

react-time-period-picker v1.0.3

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

#React time period picker Simple react component to select multiple time ranges

Getting Started

Package allows to select certain time ranges or periods.

data = {
    {start: "03:06", end: "03:10"},
    {start: "03:11", end: "03:18"},
    ...
}

alt text

alt text

import React, { Component } from 'react'
import Time from 'react-time-period-picker'
import  './react-time-period-picker/dist/time.css'
class App extends Component {

  constructor(props) {
      super(props);
      this.state = {
       
      };
  }
  onOpeningsChange(e) {
    this.setState({openings:e});
}
  render() {
    return (<div>
      <Time
        onChange={this.onOpeningsChange.bind(this)}
        data={this.state.openings}
        />
                            
    </div>)
  }
}
export default App;

Use your on css for better UI

props

PropDescriptionDefault
dataList of time ranges (Array of objects with start and end times)Array []
canOverlapAllow to overlap time rangesfalse
className---""
invalidOverlapTextInvalid message on OverlapTime cannot be overlaped
equalRangeTextinvalid message in equal time periodsTime cannot be equal

Acknowledgments

antd moment

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago