cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Visible if the Date is Between a Date Range

Summary

I have a calendar with each date arranged as below using a Gallery:

Calendar.png

 

 

 

 

 

The small blue dot below each date is currently only visible if there is an event on that date in a 'Holiday Calendar' list (using the 'start time & 'end time' fields AND the user assigned to the holiday event matches the user logged into the app.

 

calendar2.png

 

Issue

The above is all working fine and as expected. However....

 

The 16th & 20th dates which have a blue dot below them in the screenshot above is actually a WEEK booking event with 'start time' of the 16th and 'end time' of the 20th. Therefore I am looking to have my below code modified to allow the system to recognise this and also put blue dots below the 17th, 18th, & 19th as these dates are in between the 16th & 20th.

 

CountRows(Filter('Holiday Calendar', DateValue(Text('Start Time')) = DateAdd(_firstDayInView,ThisItem.Value,Days)&&User().FullName=Title|| DateValue(Text('End Time')) = DateAdd(_firstDayInView,ThisItem.Value,Days)&&User().FullName=Title))

 

Thank you for your assistance!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: Visible if the Date is Between a Date Range

Thank You Eric!

 

The code provided didn't work straight away however provided great assistance in finding the correct solution. See below your code amended by myself to do the job -

 

CountRows(Filter('Holiday Calendar', DateValue(Text('Start Time')) = DateAdd(_firstDayInView,ThisItem.Value,Days)&&User().FullName=Title

||

DateValue(Text('End Time')) = DateAdd(_firstDayInView,ThisItem.Value,Days)&&User().FullName=Title

||

And(

DateValue(Text('Start Time')) < DateAdd(_firstDayInView,ThisItem.Value,Days),

DateValue(Text('End Time')) >

DateAdd(_firstDayInView,ThisItem.Value,Days)&&User().FullName=Title)

)

)

View solution in original post

3 REPLIES 3
Highlighted
Resident Rockstar
Resident Rockstar

Re: Visible if the Date is Between a Date Range

Try this. You'll need to check if the start date is before the current date and if the end date is greater than the current date. Else it will either be caught by the first two checks or it's not an event date.

CountRows(Filter('Holiday Calendar', DateValue(Text('Start Time')) = DateAdd(_firstDayInView,ThisItem.Value,Days)&&User().FullName=Title
||
DateValue(Text('End Time')) = DateAdd(_firstDayInView,ThisItem.Value,Days)&&User().FullName=Title)
||
And(
DateValue(Text('Start Time')) < DateAdd(_firstDayInView,ThisItem.Value,Days)&&User().FullName=Title,
DateValue(Text('End Time')) >
DateAdd(_firstDayInView,ThisItem.Value,Days)&&User().FullName=Title)
)
)

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

Highlighted
Helper V
Helper V

Re: Visible if the Date is Between a Date Range

In a blank cell, say Cell B2, copy and paste the below formula into it and press the Enter key.

=IF(AND(A2>$B$1,A2<$c$1),A2, FALSE)

 

I hope this helps!

Regards,

Max

 
Highlighted
Frequent Visitor

Re: Visible if the Date is Between a Date Range

Thank You Eric!

 

The code provided didn't work straight away however provided great assistance in finding the correct solution. See below your code amended by myself to do the job -

 

CountRows(Filter('Holiday Calendar', DateValue(Text('Start Time')) = DateAdd(_firstDayInView,ThisItem.Value,Days)&&User().FullName=Title

||

DateValue(Text('End Time')) = DateAdd(_firstDayInView,ThisItem.Value,Days)&&User().FullName=Title

||

And(

DateValue(Text('Start Time')) < DateAdd(_firstDayInView,ThisItem.Value,Days),

DateValue(Text('End Time')) >

DateAdd(_firstDayInView,ThisItem.Value,Days)&&User().FullName=Title)

)

)

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (8,314)