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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Ensure one datepicker ...
Power Apps
Unanswered

Ensure one datepicker is before the other

(1) ShareShare
ReportReport
Posted on by 801

Hi all,

 

Quick question,

I have 2 datepickers on my screen and I need to ensure that the Start date is before than the expiry date, I can't seem to figure it out.

Any ideas?

Categories:
I have the same question (0)
  • Verified answer
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @RJM07 

     

    Please enter the following formula on the "OnChange" property of Start Date datepicker control:

     

    If(Self.SelectedDate >= enddate.SelectedDate,Notify("Start date should be less than end date"));Reset(Self);

    If start date is more than or equal to end date then it will notify the user and reset to default value. If you want to make start date as blank then set "DefaultDate" property to no value.

     

    Please remember to give a 👍 and accept my solution as it will help others in the future.

    Thanks

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    I can think of 2 solution.

    The new date picker (actually there are 2 new date pickers, one in canvas apps, and one in Teams app and components. The Teams/Component has this feature, the other has not. You have to go to setting in your app to turn them on. Search modern controller. To add it to a Canvas app, start a new component, add it to the "app" and copy it and paste it into you canvas app.

     

     

    The new date picker is way better than the old, but keep in mind its not datePicer.SelectedDate, but DatePicker.Value and some other minor changes. 

     

    In advanced you can set minimum date or something like that, locking the ability to select date before that time. This could be from input from another date picker as you need. 

     

    Old fashion solution

    The other solution is to change color to date text to red if it is < StartDate.SelectedDate, add a warning text (if you want) and disable the "save button" if endDate.SelectedDate < StartDate.SelectedDate

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard