reservation-time-table
v0.1.4
Published
Easy use time reservation table
Downloads
1
Maintainers
Readme
Start
npm i reservation-time-table
Props
startNum
: start timeendNum
: end timemaxTime
: maximum number of time choicescomplete
(option) : unselectable time arrayonClick
: (function) : returns an array of start time and end time- [-1, null] : nothing selected
- [2, null] : start time selected
- [2, 10] : start time and end time selected
Example
import TimeTableBox from "./lib/TimeTable";
function App() {
const [time, setTime] = useState<number[]>();
return (
<div className="App">
<TimeTableBox
startNum={10}
endNum={22}
maxTime={3}
complete={[12, 13, 20]}
onClick={(time: number[]) => setTime(time)}
/>
</div>
);
}
export default App;