Hello, I need some help using code to calculate the number of days between two datepickers excluding weekends and disabled dates.
User input form is as follows:
User selects a start date (#datePicker1)
User selects an end date (#datePicker2)
User clicks the Calculate Number of Leave Days button (#button1)
Number of Leave Days field should show the number of days between the two dates chosen EXCLUDING weekends and disabled dates (#input3)
Examples are as follows:
1. Number of Leave Days from 24 April to 27 April should be 2 DAYS --> 25 and 26 April are weekends
2. Number of Leave Days from 24 December to 28 December should be 2 DAYS --> 25 December is a public holiday (disabled date) and 26 and 27 December are weekends
All weekends and public holidays have been disabled from both datepickers already.
Please advise with the calculation. Thank you.