
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
react-bootstrap-time-picker
Advanced tools
Time Picker with bootstrap flavor
Demo and playground are available here
npm i react-bootstrap-time-picker --save
import TimePicker from 'react-bootstrap-time-picker';
<TimePicker start="10:00" end="21:00" step={30} />
Note: All props are optional.
Time Picker renders options with range between start
and end
time values with step
(inclusive).
Should be provided in the following format: "HH?(:mm?(:ss?))".
"4", "04", "4:0", "04:00", "4:0:0", "04:00:00". All these are equal to "4 hours".
"11:00 PM". Should be provided in 24-hour format only
Time Format of rendered options. Supported values: 12
or 24
.
Initial selected option. Used if value
prop is either undefined
or null
. Can be provided either in "HH?(:mm?(:ss?))" format or as int (hours * 3600 + minutes * 60 + seconds)
. If initialValue
is less than start
property value, then start
value is used instead.
"1:00", "01:00", "3600", 3600
"11:00 PM"
Function, which is triggered after one of options is selected. Return selected time in int format: (hours * 3600 + minutes * 60 + seconds)
.
class Parent extends React.Component {
constructor() {
super();
this.handleTimeChange = this.handleTimeChange.bind(this);
this.state = { time: 0 };
}
handleTimeChange(time) {
console.log(time); // <- prints "3600" if "01:00" is picked
this.setState({ time });
}
render() {
return <TimePicker onChange={this.handleTimeChange} value={this.state.time} />;
}
}
See end
property description.
Step between time options in minutes. See end
property description.
Current value. See initialValue
description.
Library doesn't validate provided props much. If you are doing something strange like setting start="10:00", end="05:00"
, then behavior is undefined, which means that it might render component differently in the future versions. Also underlying library time-number throws exceptions if provided time is not in a proper format, i.e. adl
is considered invalid.
MIT (c) Yury Dymov
FAQs
Bootstrap Time Picker React Component
The npm package react-bootstrap-time-picker receives a total of 2,004 weekly downloads. As such, react-bootstrap-time-picker popularity was classified as popular.
We found that react-bootstrap-time-picker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.