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 Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,175)