blob: 9f6c4872410ebd1c78f638163d63db870a21d39d [file] [log] [blame]
pranav nachnekar7b9e3092019-08-28 16:57:37 +05301
pranav nachnekar2cd99492019-08-30 10:49:43 +05302{% include 'erpnext/public/js/date_polyfill.js' %}
pranav nachnekar7b9e3092019-08-28 16:57:37 +05303let holidays = [];
4{% if holidays %}
5 holidays = {{holidays}}
6{% endif %}
7
8function next() {
9 let date = document.getElementsByName('appointment-date')[0].value;
10 if(holidays.includes(date)){
11 frappe.throw("That day is a holiday")
12 }
pranav nachnekar2cd99492019-08-30 10:49:43 +053013 if(date === ""){
14 frappe.throw("Please select a date")
15 }
pranav nachnekar7b9e3092019-08-28 16:57:37 +053016 let tz = document.getElementsByName('appointment-timezone')[0].value;
17 window.location = `/book-appointment/2?date=${date}&tz=${tz}`;
pranav nachnekar2cd99492019-08-30 10:49:43 +053018}
19
20function ondatechange(){
21 let date = document.getElementById('appointment-date')
22 if(holidays.includes(date.value)){
23 frappe.throw("That day is a holiday")
24 }
pranav nachnekar7b9e3092019-08-28 16:57:37 +053025}