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

后端 未结 8 1597
悲&欢浪女
悲&欢浪女 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:09

    Change line 7 from

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

    to

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

    The problem was that you want to add days, not set days.

提交回复
热议问题