0 Replies Latest reply on May 1, 2008 10:38 AM by cyan studios

    One date field autofills others but cannot pull from previous month

    cyan studios
      Here is a link to the form:

      If you fill in the "Week Ending" field by using that pop up calendar, all of the remaining dates for the week do autofill.
      Except when the "week ending" date takes place within a week that is not entirely inside of one month. So, like today, it is the first of May on a Thursday. And so the tuesday field will fill, but none of the others.

      Here is the code behind the Wednesday autofill field.

      Num2Date( (Date2Num(FromDate.formattedValue, "MMM DD, YYYY") - 6) )

      Date2Num(FromDate.formattedValue, "MMM DD, YYYY")

      Date2Num(FromDate.formattedValue, "MMM DD, YYYY") - 6

      Num2Date( (Date2Num(FromDate.formattedValue, "MMM DD, YYYY") - 6) )

      "FromDate" is the week ending field. Now, for Thursday's, every instance of - 6 changes to - 5 etc.