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 / Calendar Screen templa...
Power Apps
Unanswered

Calendar Screen template : Why 41 days ??

(0) ShareShare
ReportReport
Posted on by 392

Hello,

I'm applying Calendar screen template to my app.

To convert single calendar into multiple month (Gallery-subGallery), I read document below;

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/screen-templates/calendar-screen-reference

 

In this docs, _maxDate, which is one of query parameters to get calendar event from Outlook, is given by formula as _firstDayInView + 40. and also "the calendar displays a maximum of 41 days"

However, Count Rows of Items property of that gallery is 42! it means the calendar can displays a 42 days maximum. If so, _maxDate should given by _firstDayInView + 41

What was I missing??

 

Thanks,

Hiro

Categories:
I have the same question (0)
  • Verified answer
    v-yutliu-msft Profile Picture
    on at

    Hi @h-nagao ,

    Please note that the range of dates has many situations.

    And there is a special one:

    The set of 0 through 41 is used for the items in the calendar gallery because, in the worst-case scenario, the calendar view will have to display 42 full days. This occurs when the first of the month occurs on a Saturday and the last of the month occurs on a Sunday. In this case, the calendar shows six days from the previous month in the row containing the first of the month, and six days from the following month in the row containing the last of the month. This is 42 unique values, of which 30 are for the selected month.

     

    The doc that you mentioned has described very detailed, please read the comments blow the code.

     

     

    Best regards,

  • h-nagao Profile Picture
    392 on at

    Thanks, @v-yutliu-msft .

    I have noted your comment.

    I knew, we don't need to care 40/41, since effective items are max 31, but my point here is just consistency among description in Docs, code, and actual # of items in Gallery.

     

    Anyway, I will close this post.

     

    Thank you very much!

    Hiro  

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard