Add date limit to date-picker

Hello,
anyone know if it is possible to enter a range of dates that you can select ...
specifically, I would need to be able to select all the past dates including "today", not the future ones.
I would like to avoid using an alert, I would simply like it not possible to select future dates. thanks to anyone who will answer

This sample app does that, but with the future instead of the past.

Reverse the comparison block, and you're good to go.
https://groups.google.com/g/mitappinventortest/c/lFXcJDmbsMA/m/stKrIpKtBQAJ

Capture future_date_picker.aia (5.2 KB)

1 Like

thank you very much ... I will consider this method.
but actually i was hoping to use app inventor's standard date-picker

I suppose you could test the date after it is chosen, to see if it is in range.
If it is out of range, set it back to an acceptable value and Notify the user.

I look at the Date Picker, and it has no blocks to set its selected date.
So this is as close as you can get to what you want ...

P.S. These blocks can be dragged directly into your Blocks Editor workspace.

P.P.S. This scheme can be defeated by cancelling out from the second LaunchPicker after you have chosen a future date, like July 2.
Capture

I see no alternative to building your own Date Picker.

P.P.P.S. You could cope with that by setting a global variable and the DatePicker.Text as the value of record for the valid date choice.

1 Like

solution with compare text is just what I needed. thank you very much
ps: I could also use a math compare and use milliseconds

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.