Initial moth & year shown by the date picker in a!dateField component without a value

Hi,

We're running Appian 18.4 and have had a user comment that the date picker initially displayed by an un-set (no value) a!dateField input has changed.

Currently, if the a!dateField component has no value and the user puts focus on that input, it pops-up with the month and year based on today's date. In the past, it had popped-up with the month and year based on the previously entered date.

Context for this use case: the user is filling in travel dates for a trip into an editable grid. Each row of the grid represents one leg of the  journey. We expect that leg #2's departure date will occur on or after leg #1's arrival date. In some cases, these dates are many months or years away from the current date, so we preferred the old behaviour for the initial month in the date picker pop-up.

Is there any way to control the initial month and year is this component?

Thanks,

Mike

  Discussion posts and replies are publicly visible

  • Hi

    Can you set the second date field to display the first date's value if it's null? Then if the user doesn't change the second date, a save on the submit will save the first date into the second?

    load(
      local!date1: todate(null),
      local!date2: todate(null),
      {
        a!dateField(
          value: local!date1,
          saveInto: local!date1
        ),
        a!dateField(
          value: if(
            isnull(local!date2),
            local!date1,
            local!date2
          ),
          saveInto: local!date2
        ),
        a!buttonLayout(
          primaryButtons: a!buttonWidget(
            label: "SUBMIT",
            saveInto: a!save(
              local!date2,
              if(isnull(local!date2), local!date1, local!date2)  
            ),
            submit: true
          )
        )
      }
    )