react-toolbox/components/time_picker
Javi Velasco 0cb8d8bdb2 Get rid of jsx extensions 🔮 2016-04-10 21:23:04 +02:00
..
Clock.js Get rid of jsx extensions 🔮 2016-04-10 21:23:04 +02:00
ClockFace.js Get rid of jsx extensions 🔮 2016-04-10 21:23:04 +02:00
ClockHand.js Get rid of jsx extensions 🔮 2016-04-10 21:23:04 +02:00
ClockHours.js Get rid of jsx extensions 🔮 2016-04-10 21:23:04 +02:00
ClockMinutes.js Get rid of jsx extensions 🔮 2016-04-10 21:23:04 +02:00
TimePicker.js Get rid of jsx extensions 🔮 2016-04-10 21:23:04 +02:00
TimePickerDialog.js Get rid of jsx extensions 🔮 2016-04-10 21:23:04 +02:00
_config.scss Use sass lint 2016-04-10 12:20:59 +02:00
index.js Remove jsx extension from imports in components 2015-11-28 20:24:46 +01:00
readme.md Add inputClassName prop to DatePicker and TimePicker 2016-04-10 18:55:55 +02:00
style.clock.scss Add animated auto transition from hours to minutes in TimePicker 2015-12-12 11:35:31 +01:00
style.scss Add animated auto transition from hours to minutes in TimePicker 2015-12-12 11:35:31 +01:00

readme.md

Time Picker

A dialog picker is used to select a single time (hours:minutes). The selected time is indicated by the filled circle at the end of the clock hand.

import TimePicker from 'react-toolbox/lib/time_picker';
let time = new Date();
time.setHours(17);
time.setMinutes(28);

class TimePickerTest extends React.Component {
	state = {time};

  handleChange = (time) => {
  	this.setState({time});
  };

  render () {
  	return <TimePicker label='Finishing time' onChange={this.handleChange} value={this.state.time} />;
  }
}

Properties

Name Type Default Description
className String This class will be placed at the top of the TimePickerDialog component so you can provide custom styles.
error String Provide error text which will be displayed under the field.
inputClassName String This class will be applied to Input component of TimePicker.
format String 24hr Format to display the clock. It can be 24hr or ampm.
label String The text string to use for the floating label element in the input component.
onChange Function Callback called when the picker value is changed.
value Date Datetime object with currrently selected time.