Skip to main content
August 25, 2022
Question

Calendar Event- Interface

  • August 25, 2022
  • 5 replies
  • 0 views

I made some code like that and I want to show the event by every date

a!localVariables(
  local!viewType:"MONTH",
  local!selectedEvent,
  local!currentDate: today(),
  {
    a!sectionLayout(
      contents:{
        a!columnsLayout(
          columns:{
            a!columnLayout(
              contents:{
                a!buttonArrayLayout(
                  buttons:{
                    a!buttonWidget(
                      label:"Month",
                      value:"MONTH",
                      saveInto:local!viewType,
                      style:if(local!viewType="month","PRIMARY","SECONDARY")
                    ),
                    a!buttonWidget(
                      label:"Week",
                      value:"WEEK",
                      saveInto:local!viewType,
                      style:if(local!viewType="week","PRIMARY","SECONDARY")
                    ),
                    a!buttonWidget(
                      label:"All Day",
                      value:"DAY",
                      saveInto:{
                        local!viewType,
                        a!save(local!currentDate,today())
                      },
                      style:if(local!viewType="day","PRIMARY","SECONDARY")
                    )           
                  }
                )             
              }
            ),
            a!columnLayout(
              contents:{
                a!buttonArrayLayout(
                  buttons:{
                    a!buttonWidget(
                      label:"Previous Month",
                      value:-7,
                      saveInto:a!save(
                        local!currentDate,
                        eomonth(local!currentDate,-1)
                      )
                    ),
                    a!buttonWidget(
                      label:"Next Month",
                      value:7,
                      saveInto:a!save(
                        local!currentDate,
                        eomonth(local!currentDate,1)
                      )
                    )          
                  },
                  showWhen:local!viewType="month",
                  align:"END"
                ),              
                a!buttonArrayLayout(
                  buttons:{
                    a!buttonWidget(
                      label:"Previous Week",
                      value:-7,
                      saveInto:a!save(
                        local!currentDate,
                        local!currentDate+save!value
                      )
                    ),
                    a!buttonWidget(
                      label:"Next Week",
                      value:7,
                      saveInto:a!save(
                        local!currentDate,
                        local!currentDate+save!value
                      )
                    )          
                  },
                  showWhen:local!viewType="week",
                  align:"END"
                ),
                a!buttonArrayLayout(
                  buttons:{
                    a!buttonWidget(
                      label:"Previous Day",
                      value:-1,
                      saveInto:a!save(
                        local!currentDate,
                        local!currentDate+save!value
                      )
                    ),
                    a!buttonWidget(
                      label:"Next Day",
                      value:1,
                      saveInto:a!save(
                        local!currentDate,
                        local!currentDate+save!value
                      )
                    )          
                  },
                  showWhen:local!viewType="day",
                  align:"END"
                )                
              }
            )
          }
        )

      }
    ),
    {
      a!columnsLayout(
        columns: {
          a!columnLayout(
            contents: {
              calendarDisplayField(
                viewType: local!viewType,
                dateContext: local!currentDate,
                detailDateFormat: "YYYY-MM-DD",
                useDetailPopup: true,
                events: {
                  id:"2",
                  calendarId: "1",
                  title:"Work Conference",
                  category:"time",
                  start: today(),
                  end: today(),
                  location: "downtown",
                  attendees: "mary and joy",
                  body: "Appian Conference"
                },
                selectedEvent: local!selectedEvent
              )
            }
          )
        }
      )
    }
  }
)

Output:  

5 replies

sangilim9580
December 12, 2022

useful one

December 12, 2022

My work has been done.

What do you want to say?

sangilim9580
December 12, 2022

this code was useful for me thank you

November 15, 2023

the above code displays empty in interface

Can you please help