Calculate number of days between two dates minus weekends and holidays

Hi! May I seek for your help on how to calculate the number of days between two dates excluding weekends and public holidays using javascript. Also, how to calculate the end date (start date and duration given) excluding weekends and public holidays. Thank you.