cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Patron
Post Patron

Only show message when past date is selected.

Happy Friday!

 

Trying to figure out how to have the message "Only" display only when a user select a day in the past, In addition have the submit button disable.

DatePicker1.BorderColor: If(DatePicker1.SelectedDate < Today(), Color.Red, RGBA(101, 128, 187, 1))
Warning.Text: "Dates in the past cannot be selected"
Warning.Color: Color.Red
Warning.Visible: DatePicker1.SelectedDate < Today()

 

Timeline.PNG

 

I hope I've explained myself clearly. Thank you in advance.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Dual Super User II
Dual Super User II

Re: Only show message when past date is selected.

Hi @oappdev 

 

BorderColor

If(!IsBlank(DatePicker1.SelectedDate) && DatePicker1.SelectedDate < Today(), Color.Red, RGBA(101, 128, 187, 1))

 

Warning

IsBlank(DatePicker1.SelectedDate) ||  DatePicker1.SelectedDate < Today()

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Thanks,
Reza Dorrani, MVP
YouTube
Twitter

View solution in original post

Highlighted
Super User III
Super User III

Re: Only show message when past date is selected.

@oappdev 

To have the message "Only" display only when a user select a day in the past... it looks like you've already done this.

 

Warning.Visible: DatePicker1.SelectedDate < Today()

 

You can make the submit button disable by changing the DisplayMode property to this code.

 

If(DatePicker1.SelectedDate < Today(), DisplayMode.Disabled, DisplayMode.Edit)

 

Note:  I did not see that RezaDorrani had already posted but I think my DisplayMode code is part of the solution you'll need.  If it works you can always accept both our answers as the solution.

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

6 REPLIES 6
Highlighted
Dual Super User II
Dual Super User II

Re: Only show message when past date is selected.

Hi @oappdev 

 

BorderColor

If(!IsBlank(DatePicker1.SelectedDate) && DatePicker1.SelectedDate < Today(), Color.Red, RGBA(101, 128, 187, 1))

 

Warning

IsBlank(DatePicker1.SelectedDate) ||  DatePicker1.SelectedDate < Today()

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Thanks,
Reza Dorrani, MVP
YouTube
Twitter

View solution in original post

Highlighted
Post Patron
Post Patron

Re: Only show message when past date is selected.

Thank you @RezaDorrani , Will circle back.

Highlighted
Super User III
Super User III

Re: Only show message when past date is selected.

@oappdev 

To have the message "Only" display only when a user select a day in the past... it looks like you've already done this.

 

Warning.Visible: DatePicker1.SelectedDate < Today()

 

You can make the submit button disable by changing the DisplayMode property to this code.

 

If(DatePicker1.SelectedDate < Today(), DisplayMode.Disabled, DisplayMode.Edit)

 

Note:  I did not see that RezaDorrani had already posted but I think my DisplayMode code is part of the solution you'll need.  If it works you can always accept both our answers as the solution.

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Highlighted
Post Patron
Post Patron

Re: Only show message when past date is selected.

Thank you @mdevaney 

 

 

 

Highlighted
Post Patron
Post Patron

Re: Only show message when past date is selected.

Thank you @RezaDorrani

Accepted your solution ✔️

Highlighted
Post Patron
Post Patron

Re: Only show message when past date is selected.

Thank you @mdevaney 

Accepted your solution ✔️ for disable submit button.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,223)