blob: 113564a72286fcb28263f6db213c87ec703b3cc8 [file] [log] [blame]
pranav nachnekar7b9e3092019-08-28 16:57:37 +05301let time_slot_divs = document.getElementsByClassName('time-slot');
2
3function get_available_slots() {
4 frappe.db
5}
6
7function select_time() {
8 if (this.classList.contains("unavailable")) {
9 return
10 }
11 console.log(this.id)
pranav nachnekardbd72ea2019-08-29 16:56:19 +053012 try{
13 selected_element = document.getElementsByClassName('selected')[0]
14 }catch(e){
15 this.classList.add('selected')
16 }
17 selected_element.classList.remove('selected');
pranav nachnekar7b9e3092019-08-28 16:57:37 +053018 this.classList.add('selected');
19}
20
21for (var i = 0; i < time_slot_divs.length; i++) {
22 time_slot_divs[i].addEventListener('click', select_time);
23}
24
25function next() {
26 let urlParams = new URLSearchParams(window.location.search);
27 let date = urlParams.get("date");
28 let tz = urlParams.get("tz");
29 let time_slot = document.querySelector(".selected").id;
30 window.location.href = `/book-appointment/3?date=${date}&tz=${tz}&time=${time_slot}`;
31}