Android Question disable future or past days in SDCalendarDialog

Abdull Cadre

Active Member
Licensed User
Good morning/good afternoon everyone.

I'm seeing this @Star-Dust calendar class, and I would like to disable past or future days. I know it's possible because simple is a matter of logic and I'm having difficulty

source: https://www.b4x.com/android/forum/threads/sd-datedialog-calendar-picker.79007/

1.png
 

Attachments

  • DateDialog(3).zip
    12.6 KB · Views: 63

asales

Expert
Licensed User
Longtime User
In the sub "Sub FillCalendar", change this lines:
B4X:
Else
    Lab.Color=Colors.Transparent
    Lab.TextColor=Colors.Black
End If
to this:
B4X:
Else
    Lab.Color=Colors.Transparent
    Lab.TextColor=Colors.LightGray   '<==
    Lab.Enabled = False    '<== or make invisible : Lab.Visible = False
End If
1662645064011.png
 
Upvote 0

asales

Expert
Licensed User
Longtime User
Thanks for the quick response. but I don't know if that's exactly what you got.


Today, for example, is the 8th, so I want to disable it from the 7th to every day of every month, previous years. according to this example:
B4X:
If d=i Then
    Lab.Background=Corner(Color)
    Lab.Textcolor=Colors.White
    LabelNow=Lab
'NEW CODE
Else If d > i Then
    Lab.Color = Colors.Transparent
    Lab.TextColor = Colors.LightGray
    Lab.Enabled = False
Else
    Lab.Color = Colors.Transparent
    Lab.TextColor = Colors.Black
End If
1662656927274.png
 
Upvote 0
Top