cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
emilyyip33
Level: Powered On

Highlight date between start and end date

I am new in using powerapps. I am trying to make a leave approval app which user will choose start and end date for leave. I know powerapps has no loop function to loop through all date between.

But I want the calendar  can highlight all date between start and end date. 

 

I am really want to solve this. May someone has any ideas how to do that?

2 REPLIES 2
Super User
Super User

Re: Highlight date between start and end date

Hi,

First of all Power Apps has a loop function (ForAll) but dont think we would need that here.

How are your dates displayed? Is it in a calendar control? Or are they displayed using another control?

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit Bhatia
https://thepoweraddict.com
Community Support Team
Community Support Team

Re: Highlight date between start and end date

Hi @emilyyip33 ,

Do you pick up the Start Date and End Date using single one DatePicker control or Calendar control?

Do you want to highlight the date between the Start date and End Date within your DatePicker control?

 

If you picked up the Start Date and End Date using single one DatePicker control or Calendar control, I afraid that there is no direct way to achieve your needs.

If you want to pick up the Start Date and End Date using single one DatePicker control or Calendar control, I think custom interactive calendar view could achieve your needs. Please check and see if the following blog would help in your scenrio:

https://blogs.msdn.microsoft.com/davidni/2016/12/13/building-an-interactive-calendar-view-with-power...

 

Within above custom interactive calendar view, you could select a date range (Start date and End Date) within a single one Calendar.

 

In addition, if you want to loop the dates between the Start Date and End Date, I think the ForAll function (Loop Function) could achieve your needs. I have made a test on my side, please consider take a try with the following workaround (set the OnSelect property of a button to following😞

Clear(DateRanges);
ForAll(      
  FirstN([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31], DateDiff(StartDate, EndDate) + 1),
      Collect(
              DateRanges,
              DateAdd(StartDate, Value, Days)
      )
)

When you execute above formula, the date ranges between the Start Date and End Date would be stored within the DateRanges collection. You could add a Data Table control in your app, then connect it to the DateRanges collection, then you could see the date ranges.

 

Best regards,

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

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 (3,708)