Appian Community and Appian Academy are being upgraded. From July 24–August 3, the Appian Community will be in read-only mode. During this time, the site will be read-only and user registration will be disabled. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!

The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.

Date validation

Certified Lead Developer

I know this may sound little trivial but I couldn't figure out the logic.

I want a button should be enabled before 5 calendar days from the last date of the month to the first 3 calendar days of next month.

Example from if it's Aug, then it should enable on 26 Aug and stay enabled until 3 Sept.

Any help appreciated.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Hey varun, Could you please the attached code once please

    a!localVariables(
      /*your actual date*/
      local!data:today()-7,
      /*getting last 5th date of the month*/
      local!startDate: eomonth(local!data,0)-5,
       /*from the last 5th date adding 8 to go to next month's 3rd day*/
      local!endDate:local!startDate+8,
      
      a!buttonLayout(
        showWhen: and(
          local!startDate<today(),
          today()<local!endDate
        ),
        primaryButtons: {
          a!buttonWidget(
            label:"Submit"
          )
        }
      )
    )

Reply
  • 0
    Certified Lead Developer

    Hey varun, Could you please the attached code once please

    a!localVariables(
      /*your actual date*/
      local!data:today()-7,
      /*getting last 5th date of the month*/
      local!startDate: eomonth(local!data,0)-5,
       /*from the last 5th date adding 8 to go to next month's 3rd day*/
      local!endDate:local!startDate+8,
      
      a!buttonLayout(
        showWhen: and(
          local!startDate<today(),
          today()<local!endDate
        ),
        primaryButtons: {
          a!buttonWidget(
            label:"Submit"
          )
        }
      )
    )

Children
  • 0
    Certified Lead Developer
    in reply to deepakg681722

    I am so sorry, for disable please try this code.

    a!localVariables(
      /*your actual date*/
      local!data: today() - 7,
      /*getting last 5th date of the month*/
      local!startDate: eomonth(local!data, 0) - 5,
      /*from the last 5th date adding 8 to go to next month's 3rd day*/
      local!endDate: local!startDate + 8,
      a!buttonLayout(
        primaryButtons: {
          a!buttonWidget(
            label: "Submit",
            disabled: not(
              and(
                local!startDate < today(),
                today() < local!endDate
              )
            )
          )
        }
      )
    )