web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / how to control calende...
Power Apps
Unanswered

how to control calender screen

(0) ShareShare
ReportReport
Posted on by

i have calender screen in powerapps , and added date picker ,by selecting any date ,particular month of calendar should display. how to do this any idea?

Categories:
I have the same question (0)
  • JatinSaini Profile Picture
    428 on at

    Hi @venky232 ,

     

    To display a particular month on the calendar in PowerApps when selecting a date from a date picker, you can follow these steps:

    Set up your Calendar control:

    Add a Calendar control to your PowerApps screen.
    Configure the properties of the Calendar control as needed (e.g., first day of the week, format, etc.).
    Add a Date Picker control:

    Add a Date Picker control to your PowerApps screen.
    Create a variable to store the selected date:

    Go to the "Variables" tab on the left pane.
    Click "New" to create a new variable.
    Give the variable a name (e.g., SelectedDate) and set its type to Date.
    Link the Date Picker to the variable:

    Select the Date Picker control.
    In the right pane, under the "Advanced" tab, find the "OnSelect" property.
    Set the "OnSelect" property to the following formula:

    Set(SelectedDate, DatePicker1.SelectedDate)

    Display the selected month in the Calendar:

    Select the Calendar control.
    In the right pane, under the "Advanced" tab, find the "DisplayDate" property.
    Set the "DisplayDate" property to the variable we created earlier:

    SelectedDate

    Now, when you select a date from the Date Picker control, the Calendar control will automatically display the selected month. It does this by setting the "DisplayDate" property of the Calendar to the value of the "SelectedDate" variable, which is updated whenever you pick a new date from the Date Picker.

    Make sure you have both the Date Picker and Calendar controls configured correctly, and the variable is being updated with the selected date. By doing this, your PowerApps calendar will display the particular month that corresponds to the date you select in the Date Picker.

  • venky232 Profile Picture
    on at

    iam using default calender template screen, not finding option to replace in back and forward icons of selected month

  • JatinSaini Profile Picture
    428 on at

    If you are using the default Calendar template screen in PowerApps, you might not have direct access to modify the back and forward icons for navigating between months. However, there might be alternative ways to achieve the desired functionality. Here's a workaround you can try:

    1. Create two buttons:

      • Add two buttons to your PowerApps screen, one for moving to the previous month and another for moving to the next month. You can use any icons or labels you prefer.
    2. Create variables for the displayed month and year:

      • Go to the "Variables" tab on the left pane.
      • Click "New" to create two new variables: "DisplayedMonth" (Type: Number) and "DisplayedYear" (Type: Number).
    3. Set initial values for the variables:

      • Set the initial values for the "DisplayedMonth" and "DisplayedYear" variables based on the current month and year. You can use the Today() function to get the current date and extract the month and year from it.
    4. Navigate to the previous month:

      • Select the button for moving to the previous month.
      • In the right pane, under the "Advanced" tab, find the "OnSelect" property.
      • Set the "OnSelect" property to the following formula:
         

     

    Set(DisplayedMonth, DisplayedMonth - 1);
    If(DisplayedMonth = 0, Set(DisplayedMonth, 12));
    If(DisplayedMonth = 12, Set(DisplayedYear, DisplayedYear - 1));

     

    • Navigate to the next month:

      • Select the button for moving to the next month.
      • In the right pane, under the "Advanced" tab, find the "OnSelect" property.
      • Set the "OnSelect" property to the following formula:
         

     

    Set(DisplayedMonth, DisplayedMonth + 1);
    If(DisplayedMonth = 13, Set(DisplayedMonth, 1));
    If(DisplayedMonth = 1, Set(DisplayedYear, DisplayedYear + 1));​

     

    • Update the Calendar control's DisplayDate property:

      • Select the Calendar control.
      • In the right pane, under the "Advanced" tab, find the "DisplayDate" property.
      • Set the "DisplayDate" property to the following formula:

     

    Date(DisplayedYear, DisplayedMonth, 1)

     

    With these steps, you have created buttons that allow you to navigate between months. By clicking the buttons, the "DisplayedMonth" and "DisplayedYear" variables are updated accordingly, and the Calendar control's "DisplayDate" property is set to show the selected month and year.

  • venky232 Profile Picture
    on at

    but i want to control with  one date picker

  • JatinSaini Profile Picture
    428 on at

    Hi @venky232 ,

    I got your ask now, I have tested it and it's working fine. If you are using the calendar template screen without changing names of any of the variables, the do this:

     

    Update the code on these two pointers:

    JatinSaini_0-1690442888576.png

    1st:

    On the iconCalender 'OnSelect' porperty replace Today() with DatePicker.SelectedDate

    JatinSaini_1-1690443010063.png

     

    Now on the DatePicker control - 'OnChange' property write the code - Select(iconCalender)

    JatinSaini_2-1690443113819.png

     

     

     

    This will 100% work

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard