cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Eben98
Advocate II
Advocate II

Calendar Validation for next 3 months.

Hi all, 

I have a date picker in which I should allow the user to only enter dates before the next 3 months.

this month is October. I want them to only enter dates till January end. How can this be done?

If they enter dates after January they shouldn't be able to summit. 

 

Thanks in Advance.

 

Best Wishes,

Eben.

1 ACCEPTED SOLUTION

Accepted Solutions
gabibalaban
Super User II
Super User II

Hi @Eben98,

1. The OnChange property of the date picker control will help to achieve your goal , use there the Reset(DatePicker1) function into a If clause. Something like this:

 

    If(DatePicker1.SelectedDate>DateAdd(Today(),3,Months), Reset(DatePicker1))

 

Also, for usability, you can:

    -  put an error label to explain to users why the datepicker control was reseted. And Set the visible property of this label to be true when the selected date does not meet your condition. 

   - set the Display Mode property of the submit button to Disabled when  the selected date does not meet your condition.

 

2. Set the Default property of date picker control to Today().

View solution in original post

1 REPLY 1
gabibalaban
Super User II
Super User II

Hi @Eben98,

1. The OnChange property of the date picker control will help to achieve your goal , use there the Reset(DatePicker1) function into a If clause. Something like this:

 

    If(DatePicker1.SelectedDate>DateAdd(Today(),3,Months), Reset(DatePicker1))

 

Also, for usability, you can:

    -  put an error label to explain to users why the datepicker control was reseted. And Set the visible property of this label to be true when the selected date does not meet your condition. 

   - set the Display Mode property of the submit button to Disabled when  the selected date does not meet your condition.

 

2. Set the Default property of date picker control to Today().

View solution in original post

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 (16,835)