mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-18 09:47:14 +00:00
Better date validation
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
|
||||
{% include 'erpnext/public/js/date_polyfill.js' %}
|
||||
let holidays = [];
|
||||
{% if holidays %}
|
||||
holidays = {{holidays}}
|
||||
@@ -9,6 +10,16 @@ function next() {
|
||||
if(holidays.includes(date)){
|
||||
frappe.throw("That day is a holiday")
|
||||
}
|
||||
if(date === ""){
|
||||
frappe.throw("Please select a date")
|
||||
}
|
||||
let tz = document.getElementsByName('appointment-timezone')[0].value;
|
||||
window.location = `/book-appointment/2?date=${date}&tz=${tz}`;
|
||||
}
|
||||
|
||||
function ondatechange(){
|
||||
let date = document.getElementById('appointment-date')
|
||||
if(holidays.includes(date.value)){
|
||||
frappe.throw("That day is a holiday")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user