Android Question B4XDateTemplate-How to Disable Certain Date ?

lkching7

Member
Licensed User
Longtime User
Hi. Do you know how to disable certain date selection on B4XDateTemplate, like the picture below .
Many Thank .

WeChat Image_20210909105353.jpg
 

lkching7

Member
Licensed User
Longtime User
It doesn't support such feature. It shouldn't be too difficult to take B4XDateTemplate code from the b4xlib file, rename it and modify it.
May I know how to take B4XDateTemplate code from the b4xlib file
 
Upvote 0

udg

Expert
Licensed User
Longtime User
B4xlib files are zip compressed files. So just change the extension from .b4xlib to .zip and extract the content.
Among the file you'll find the class you need (B4XDateTemplate). Save it with a different name (to avoid conflicts) and change its code as it suits your needs.
Then in your app refer to your version of the template instead of using the original one.
 
Upvote 0

lkching7

Member
Licensed User
Longtime User
B4xlib files are zip compressed files. So just change the extension from .b4xlib to .zip and extract the content.
Among the file you'll find the class you need (B4XDateTemplate). Save it with a different name (to avoid conflicts) and change its code as it suits your needs.
Then in your app refer to your version of the template instead of using the original one.

Thank So Much ! udg :)
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
how to disable certain date selection on B4XDateTemplate
Before you embark in modifying the class module, you may want to look at post #7 by Erel in the below thread that has a full example to disable dates outside a 10 day range on either side of the current date. It can be modified to say, allow only dates from today forward and so on.
 
Last edited:
Upvote 2

lkching7

Member
Licensed User
Longtime User
Before you embark in modifying the class module, you may want to look at post #7 by Erel in the below thread that has a full example to disable dates outside a 10 day range on either side of the current date. It can be modified to say, allow only dates from today forward and so on.

Ya. I saw this post also. But I like to "pre disable" the date selection rather than user try the date one by one. because I want to apply the calendar in booking function, some date was already booked. so I like to disable it before user click the date.
 
Upvote 0
Top