Android Question AnotherDatePicker prevent from selecting gray/invalid days

admerc

New Member
tmp-cam-2168702677599405363.jpg

Please help....how to prevent selecting gray/invalid days
 

Mahares

Expert
Licensed User
Longtime User
how to prevent selecting gray/invalid days
If by saying gray/invalid days you mean dates before today's date, you can then use the below code. which disallows selecting any date prior to today's date. If not, please put a little code or explain further exactly what you mean.
B4X:
Sub AnotherDatePicker2_DateChanged (NewDate As Long)
    If NewDate < DateTime.Now Then
        AnotherDatePicker2.Date = DateTime.Now
    End If
End Sub
There is also B4XDateTemplate in XUI Views you can use
 
Upvote 0

MikeSW17

Active Member
Licensed User
Not sure which version of AnotherDatePicker you're using. Neither of the example programs [ the Depreciated: https://www.b4x.com/android/forum/t...epicker-a-simple-web-style-date-picker.27548/ or the replacement XUI Views version: https://www.b4x.com/android/forum/t...ss-platform-views-and-dialogs.100836/#content ] look like your example - there are no grey dates. Only the valid dates for the month are displayed. Clicking anywhere other than a displayed date does nothing.

I'm not familiar with ADP, bur maybe there is a setting to alter the behaviour you/I see. No doubt looking at the linked examples and comparing with your usage will reveal all.
 
Upvote 0
Top