cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
devipriyanka
Microsoft
Microsoft

Disable the future dates in datepicker

Can we disable the future dates in the date picker instead of restricting manually.
Please suggest.

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
ganeshsanap
Super User
Super User

@devipriyanka Presently there is no way of preventing users selecting future dates using the properties of the PowerApps date picker control.

 

However you can achieve this using formulas. Check workarounds given in below posts, it should help you:

  1. DatePicker - disable future days 
  2. Restrict Selection of Future Dates in PowerApps Date Picker 
  3. https://stackoverflow.com/questions/56580338/powerapps-date-picker-control-how-to-set-mindate-and-ma... 

Also, you can vote on below Idea:

PowerApps Datepicker disable / restrict dates 


Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

View solution in original post

3 REPLIES 3
ganeshsanap
Super User
Super User

@devipriyanka Presently there is no way of preventing users selecting future dates using the properties of the PowerApps date picker control.

 

However you can achieve this using formulas. Check workarounds given in below posts, it should help you:

  1. DatePicker - disable future days 
  2. Restrict Selection of Future Dates in PowerApps Date Picker 
  3. https://stackoverflow.com/questions/56580338/powerapps-date-picker-control-how-to-set-mindate-and-ma... 

Also, you can vote on below Idea:

PowerApps Datepicker disable / restrict dates 


Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

View solution in original post

GarethPrisk
Super User II
Super User II

The regular Power Apps control does not support this. It supports limiting the Year, but not specific dates. As you mentioned, you'll need to reactively respond to user's input.

 

The Dataverse for Teams control does support something like this, however. You can technically copy this control to a regular Power Apps studio, but it has some implications.

 

The last option is to create/find a reusable component for a date picker. My buddy @PowerAddict has a great control for this already: https://thepoweraddict.com/revamping-the-date-picker-control-v3/

 

Pstork1
Dual Super User III
Dual Super User III

You can also put the following in the OnChange event of the datepicker.  If the user picks a future date it will automatically reset it to Today.

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


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (94,410)