MCPcopy Create free account
hub / github.com/codemistic/Web-Development / InputTimer

Class InputTimer

alarm/src/App.js:7–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5var x=0;
6
7class InputTimer extends React.Component{
8
9 constructor(params){
10
11 super(params);
12 this.state={selectedtime:''};
13 this.Storetime= this.Storetime.bind(this);
14 }
15 componentDidMount(){
16
17 }
18 Storetime(){
19
20 audio.pause();
21 audio.currentTime=0;
22 var n=this.timerID=setInterval(()=>{
23 // let date=new Date();
24 var y=this.state.selectedtime;
25 var t=((new Date()).toTimeString().substring(0,5));
26
27 x++;
28 if (y==(t)) {
29 //alert("hello bitches");
30 // console.log("hey");
31 audio.play();
32 }
33 else if(x==300){
34 audio.pause();
35 audio.currentTime=0;
36 x=0;
37 clearInterval(n);
38
39 }else {
40
41 }},1000)
42console.log(this.state.selectedtime);
43 }
44
45 render(){
46
47 return(<>
48
49 <input onChange={e => this.state.selectedtime=e.target.value} id={'Timertime'} value={this.state.selectedtime} type={"time"} ></input>
50 <br/>
51 <button onClick={this.Storetime}>select time</button>
52 </>)
53 }
54}
55export default App;
56
57class Clockclass extends React.Component{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected