cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
h-nagao
Level 10

Calendar Screen template : Why 41 days ??

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-refere...

 

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

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Calendar Screen template : Why 41 days ??

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,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Calendar Screen template : Why 41 days ??

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,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

h-nagao
Level 10

Re: Calendar Screen template : Why 41 days ??

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  

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,991)