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

Community site session details

Session Id : dkHoAStQIgKno2qpzUHeTE
Power Apps - Building Power Apps
Answered

Button to change the day of a calendar picker

Like (0) ShareShare
ReportReport
Posted on 17 Mar 2022 15:11:09 by 169

Hello I have a date picker with two button, one button to move forward one day and the other to move back a day but I can't do a good function to make it work, I have set two var for the two button  true to move foward and false to move back and i've put this in my date picker default date 

 

Switch(varThisDay;
true; Date(Year(Today());Month(Today());Day(Today()));
false; DateAdd(Date(Year(Today());Month(Today());Day(Today())); -1; Days))

 

but It don't work like I want, for exemple today is the 17 but when I click and the button to move foward it does nothing because it is set to go at today and the button to move back just move back one day and dont move back again if I want to go at the day 15

and I don't find how to maki this work

  • TRob Profile Picture
    2 on 02 Feb 2024 at 15:18:03
    Re: Button to change the day of a calendar picker

    Any chance you could share how this is accomplished? I would love to have the functionality to advance a date slider by a month instead of individually selecting/setting the start date and end date.

  • Dive1 Profile Picture
    169 on 17 Mar 2022 at 16:04:33
    Re: Button to change the day of a calendar picker

    Thank you it works

  • Verified answer
    RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 17 Mar 2022 at 15:56:21
    Re: Button to change the day of a calendar picker

    @Dive1 

    Set the OnSelect of your forward button to:

        UpdateContext({lclDate: DateAdd(Coalesce(lclDate, Today()), 1)})

    Set the OnSelect of your backward button to:

        UpdateContext({lclDate: DateAdd(Coalesce(lclDate, Today()), -1)})

    Then set the DefaultDate on your date chooser to:

        Coalesce(lclDate, Today())

     

    I hope this is helpful for you.

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete