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 / Define the date range ...
Power Apps
Unanswered

Define the date range to display in a date field in a model driven app

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi All, 

 

I am looking to define a date range in a date field itself that can be selected, as in a week before today and today only. No future dating and Nothing too in the past. I've tried to google but getting a little lost.  

 

Is there an easy way to do this within a model driven app? 

 

Thanks!

 

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Tia ,

     

    You could add a filter condition in a view.

    vbofengmsft_1-1701220397757.png

     

    vbofengmsft_0-1701220324339.png

     

    Best Regards,

    Bof

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Apologies, I wasn't clear enough - I mean in the date field itself. When selecting a date in the calendar - I want the person to only be able to select very specific dates. 

  • a33ik Profile Picture
    3,306 Most Valuable Professional on at

    Hello,

    If you want those validations to happen in-line you have 2 ways:

    1. JavaScript - add 2 fields to the form and write a JavaScript that will handle onChange events of from/to fields and wipe out/reset values if the new datetime value is not valid for the selection.

    2. PCF Control. I checked pcf.gallery and the closest that I found was the following - https://pcf.gallery/date-range-control/ but it doesn't allow to limit date ranges to be chosen. It seems that react component it was built on top of allows that limitation of datetime range - https://www.npmjs.com/package/react-date-range

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard