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 Apps
Answered

Date Picker

(0) ShareShare
ReportReport
Posted on by 125

Hello,

 

I would like to restrict the date a user can choose in the date picker to a Sunday.  Is there a way to do this?

 

If not, I am finding that there is a way to display an error message if the user doesn't pick a Sunday in the date picker with this code--

If(Weekday(DatePicker1.SelectedDate)=1, "Valid date", "Not a valid date")

 

My second question is where do I put this code?  Items property?  Update property?

 

Thank You,

 

Jamie

 

@RandyHayes 

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,570 Most Valuable Professional on at

    Hi @jamiekim .

    Put this on the OnChange of the Date Picker

    If(
     Weekday(Self.SelectedDate) <> 1,
     Notify(
     "Only Sundays allowed",
     Error
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • jamiekim Profile Picture
    125 on at

    Thank you, that's awesome, it worked!!

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 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard