need help on date field

Certified Associate Developer

Hi all,

having one requirement like there are two dates  date 1 & date 2.then date 2 should be equal to + 1 day of date 1 (only week days, no sat, Sunday) what should I do?

  Discussion posts and replies are publicly visible

Parents Reply
  • So the issue here is, while this will show the "value" of "Date2" as "ri!date1+1", that value will never get saved into ri!date2, because the saveInto parameter of a component never evaluates until the user changes the value of that component.

    The actual way to get the "ri!date1" component to effect the value of ri!date2, is to use the saveInto in the "Date1" date field to target BOTH variables (and preferably, show the "Date2" field as read-only).

    saveInto: {
      ri!date1,
      
      a!save(ri!date2, ri!date1 + 1)
    }

    As far as adding 1 to "date1" value but skipping weekends - i'm afraid Stefan already answered your question above along with the linked documentation which I even provided you a highlight of - to reiterate, you'll want to use a!addDateTime() and utilize the advanced functionality it contains, which includes a way to observe the system calendar in its date addition.

Children