1.4.0 • Published 6 years ago

react-time-range-picker v1.4.0

Weekly downloads
31
License
-
Repository
github
Last release
6 years ago

react-time-range-picker

A simple HTML5 canvas time range picker in React.

Installation

npm i react-time-range-picker

Demo

alt text alt text

Usage

import TimeRangePicker from 'react-time-range-picker'; <TimeRangePicker hourmarkers hourlines/>

Example

import React, { Component } from 'react';
import TimeRangePicker from 'react-time-range-picker';

export default class App extends Component {

  pickerupdate = (start_time, end_time) => {
    // start and end time in 24hour time
    console.log(`start time: ${start_time}, end time: ${end_time}`)
  }

  render() {
    return (
      <div>
	      <TimeRangePicker hourmarkers hourlines timeupdate={this.pickerupdate}/>
      </div>
    );
  }
}

Props

hourmarkers - enables vertically numbered list of 12hour format markers.

hourlines - enables horizontal hour lines.

rangecolor - css color string to set range color.

markercolor - css color string to set vertical markers

markerfont - defaults to css string "15px Arial".

timeupdate - function which is called on mouseup with start_time and end_time respectively in 12 hour time format.

snapto - defaulto to 50, that is, 50% of the hour. set to 1 for highest granuality, i.e snapto={1}.

1.4.0

6 years ago

1.3.3

7 years ago

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

0.1.0

7 years ago

1.2.6

7 years ago

1.2.5

7 years ago

1.2.4

7 years ago

1.2.4-0

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago