web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Question About Day Sel...
Power Apps
Unanswered

Question About Day Selection in Calendar

(0) ShareShare
ReportReport
Posted on by 36

I created a calendar in SharePoint and I added in PowerApps like data.
Users can not select after days or next days. It is okay for my app actually.
But I want to add some innovation if it is possible.

I want the previous or next days to appear in a different color, so that the user can more easily understand that they cannot select them.

Is it possible?

 

 

tguckiran_1-1692393841885.png

 

 

I am sharing the code that I have made it unable to make a selection below in case it may help others.

If(Self.SelectedDate > Today() || Self.SelectedDate < Today() , Reset(Self))

 

Categories:
I have the same question (0)
  • Devvj Profile Picture
    1,132 Super User 2024 Season 1 on at

    Hi,
    you could use the DateAdd() to add or subtract days for your logic, for example "DateAdd(Today(), 1)" will give you "tomorrows date" and "DateAdd(Today(), -1)" will give you "yesterdays date".

    Hope that makes things easier.

    -------------------------------------------------------------------------
    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

  • tguckiran Profile Picture
    36 on at

    Hi,

    Unfortunately my request does not match your answer.

    I want,

    When the user click the calendar, have to seen red or different color for past and next days.

  • developerAJ Profile Picture
    4,763 on at

    i guess u r using a calendar screen and built calendar

     

    Use below code as  fill property

     

     

    If(
     
     DateAdd(_firstDayInView, ThisItem.Value) <> Today() && DateAdd(_firstDayInView, ThisItem.Value) = _dateSelected, RGBA(0,0,0,0),
     
     DateAdd(_firstDayInView, ThisItem.Value) <> Today(), ColorFade(Subcircle1.Fill, 0.67), 
     
     Abs(Self.Text - ThisItem.Value) > 10,RGBA(200, 200, 200, 0.3), RGBA(0, 0, 0, 0))

     

     

    developerAJ_0-1692450171883.png

     

  • tguckiran Profile Picture
    36 on at

    Hi,

    Firstly thank you for answer,

    When I wrote this code in fill section I saw lots of mistake in formula bar. This code is not working for me. I don't understand why.

  • tguckiran Profile Picture
    36 on at

    When I write this code in the Fill section
    The user saw it in red because the default selection is older than today's date.
    When he opens the calendar, the past days not see red.

    If(
    DataCardValue5.SelectedDate < Today(),
    Color.Red, // Past dates should be in red
    If(
    DataCardValue5.SelectedDate > Today(),
    Color.Red, // Future dates should also be in red
    Color.Black // Today's date can remain in default color (black)
    )
    )


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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 742

#2
Valantis Profile Picture

Valantis 474

#3
Haque Profile Picture

Haque 358

Last 30 days Overall leaderboard