One of the Projects I am working on part of a list form, I have two date fields as Start Date and End Date which users have to populate when they submit the form. The challenge I am facing here is to disable weekday selection and make sure only weekend dates are allowed to enter.If there is no way to disable the weekday dates, then I would like to at least show a custom validation message that would prompt user as entered date is invalid.
Taking one step ahead, based on the inputs in above two fields, I would like to create a third column of type calculated which would show a number value based on the date population in the above field.
Let's say if user enters 22nd and 23rd June as Weekend dates in start date and end date respectively then the calculated field would show value as 1 (not two), Saturday and Sunday would equal to 1 credit and if either only Saturday or Sunday date is entered, for example if a user enters 22nd June as start date and end date then the calculated column would show value as .5 (since employee worked for only one day). Third case would be let's say if an employee works for 2 weekends, then they would enter start and end dates as 6/9, to 6/17, now this date period would involve 2 Saturdays and 2 Sundays so the calculated column value would be shown as 2 (.5 for each weekend day). This is meant for employees who travel to different cities and part of a company event, they have to work on a weekend day, for which they get credit and that is exactly what we are trying to achieve here. Also, they only get credit if they work on a weekend not on a weekday. The only exception is if an employee works on a weekday which is a holiday for example 4th of July which is a weekday holiday and if an employee works on 4th of July then they would get .5 credit for that day as well so if possible I would like to account for holiday as well which falls on to weekday.
Please help with JS/JQ approach for this as I am working with SharePoint online.