
Announcements
Hi all,
I was hoping this would be simple, but I am still struggling to figure it out. I have a button in an app that prevents the user from selecting it if they enter a date more than 1 day in the past. All I need to do, is add the same functionality but this time for days in the future.
An example: A user cannot submit a form if they input the dates (9/18/2021) or (9/22/2021) if they are using the app on (9/20/2021)
I am currently using this function to prevent the submit button from being accessed if the selected date is in the past:
If(DateDiff(DataCardValue18.SelectedDate, Today(),Days) > 1, DisplayMode.Disabled, Edit)
If anyone knows how to get the same result for future dates, please let me know!
This will work for DateDiff generating a negative number of days too:
If(Abs(DateDiff(DataCardValue18.SelectedDate, Today(),Days)) > 1, DisplayMode.Disabled, DisplayMode.Edit)
Hope that helps,
Bryan