Calculate an expected delivery date (accounting for holidays) in business days using JavaScript?

后端 未结 8 1571
悲&欢浪女
悲&欢浪女 2020-12-16 05:04

After revisiting this script, and some modifications, the following is available to allow a user to add a feature that calculates the expected delivery date.



        
8条回答
  •  天涯浪人
    2020-12-16 05:30

    ship.setDate( safety );  // add a number of days
    

    Doesn't add days. It sets the day. More info

    The setDate() method sets the day of the Date object relative to the beginning of the currently set month.

    If you want to add days do something like this:

    ship.setDate(ship.getDate()+1);
    

提交回复
热议问题