-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtesting.js
More file actions
46 lines (29 loc) · 968 Bytes
/
testing.js
File metadata and controls
46 lines (29 loc) · 968 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
var string = "13:45:00"
var string2 = "24:45:00"
var appointmentLength = 15
console.log(new Date())
var value1 = parseInt(string.slice(0, 2))*100 + parseInt(string.slice(3, 5))
var value2 = parseInt(string2.slice(0, 2))*100 + parseInt(string2.slice(3, 5))
var days = []
var today = new Date();
var someDate = new Date();
someDate.setDate(someDate.getDate() + 1);
var appointments = []
var i = 0
var Difference_In_Time = someDate.getTime()- today.getTime();
var Difference_In_Days = Difference_In_Time / (1000 * 3600 * 24);
console.log(Difference_In_Days)
while((value2 - value1) > appointmentLength){
appointments.push({time : value1,
patient : null})
value1 = value1 + appointmentLength;
}
console.log(appointments)
while(Difference_In_Days > 0){
days.push({date : today.getTime(),
times : appointments
})
today.setDate(today.getDate + 1)
Difference_In_Days = Difference_In_Days - 1
}
console.log(days)