I am not sure there is an easy way to disable the entire columns, someone may be able to offer you that, But, give this a try Toby. You are not shy, you will let us know if it is not suitable for you.n easy way to disable other 5 columns: Tuesday, Wednesday, Thursday, Friday and Saturday.
Private DateTemplate As B4XDateTemplate
Sub Button1_Click
Wait For (GetDateSundayOrMonday) Complete (Ticks As Long)
If Ticks > 0 Then
Log($"Selected date: $Date{Ticks}"$)
End If
End Sub
Private Sub GetDateSundayOrMonday As ResumableSub
Do While True
Wait For (dialog.ShowTemplate(DateTemplate, "", "", "Cancel")) Complete (Result As Int)
Dim zero As Long = 0
If Result = xui.DialogResponse_Cancel Then Return zero
If DateTime.GetDayOfWeek(DateTemplate.Date) > 2 Then 'sun and mond allowed
Wait For (dialog.Show("Invalid date", "Ok", "", "")) Complete (Result As Int)
Else
Return DateTemplate.Date
End If
Loop
Return 0
End Sub
The code I posted for you disables every day of the week except Sunday and Monday of any date.. I tested it and it works. But, can you show how you modified the code in post #3 link to make it work for you, because its code allows you to only select a given date between two dates, not necessarily Sunday or Monday. I am curious. Thanksboth of above solutions work for me
Your solution is much better since I don't have to make any change; I've focused too much on the validation approach to pay attention to other details. Both solutions use validation after user selection instead of disabling unwanted dates, which is how I plan to implement in my app.The code I posted for you disables every day of the week except Sunday and Monday of any date