cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ReyOrtiz
Resolver I
Resolver I

How to add Holidays to Calendar in P-app

Hi all

I have been looking and cannot find how to add holidays to a calendar by the name of the holiday. I'm trying to create a calendar allowing teams to book training. However, we dont want them to use the holiday and the week the holiday falls into. I understand these are two different issues but knowing me. I will also need help to block the wee, which I assume will be done by disconnecting the view of some sort.
thank you 

Best Regards

Rey

1 ACCEPTED SOLUTION

Accepted Solutions
ReyOrtiz
Resolver I
Resolver I

I seem to understand your suggestion, but I don't know how to start it. This is what shows in Item

ReyOrtiz_0-1663110494214.png

this is on a gallery inside the calendar gallery for the Holidays,

Filter(HolidayList,ThisItem.Value>='Effective Date',ThisItem.Value<='Effective Date')

 

And this is the calendar in SharePoint

ReyOrtiz_1-1663110699403.png

 

View solution in original post

6 REPLIES 6
EricBLott
Resolver III
Resolver III

Are you wanting to disable certain days/weeks in the default DatePicker control in Power Apps, or are you creating a custom calendar?

ReyOrtiz
Resolver I
Resolver I

Is a custom calendar no date picker

EricBLott
Resolver III
Resolver III

@ReyOrtiz We'll need more info on the custom calendar, but typically, you'd leverage the DisplayMode property. You'll need a collection (or some data source) of all the holidays relevant, and then if the day/week contains a holiday, you'll set the DisplayMode to Disabled.

ReyOrtiz
Resolver I
Resolver I

I got the calendar to display the name ( don't ask me how), and I used the same formula. But, now, since some holidays can fall in the middle of the week, how can I disable the week? For example, if it is on Wednesday, I would like the Wednesday to be disabled but the Monday and Tuesday before it, and Thursday and Friday. 

EricBLott
Resolver III
Resolver III

You can use the WeekNum() function to check if a date's week number (the week of the year) is equal to any holiday's WeekNum() value of the holiday collection.

ReyOrtiz
Resolver I
Resolver I

I seem to understand your suggestion, but I don't know how to start it. This is what shows in Item

ReyOrtiz_0-1663110494214.png

this is on a gallery inside the calendar gallery for the Holidays,

Filter(HolidayList,ThisItem.Value>='Effective Date',ThisItem.Value<='Effective Date')

 

And this is the calendar in SharePoint

ReyOrtiz_1-1663110699403.png

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,301)