1 Reply Latest reply on Jan 12, 2011 12:42 AM by try67

    Date calculation script including Public Holidays.

    sthompson86

      Adobe Scripters,

       

      Currently working on a Target date caculator that is working perfectly, but....

       

      When a public holiday falls into play within the date timeframe i will ignore it.

       

      Any possible way to manually put in a list of 11 public holidays to complete my form?

       

      My current code is as follows....

       

      // Current time + 20 Working days (excludes Weekends)
      event.value = "";
      var strDate = this.getField("DateCurrent").value;
      if(!/^\s*$/.test(strDate))
      {
        var oDate = util.scand("mm/dd/yy,  ddd, hh:MM:ss ",strDate);
        if(oDate) {
      var msPerDay = 24 * 60 * 60 * 1000;
      if (oDate.getDay()==0) {
        numDays = 26;
      } else if (oDate.getDay()==6) {
        numDays = 27;
      } else numDays = 28;
      oDate.setTime((numDays*msPerDay) + oDate.getTime());
          event.value = util.printd("dddd dd-mmm-yyyy - HH:MM:ss", oDate);
        }
      }

       

      Thanks in advance,

       

      Steven Thompson