B4J Library jdgADP - AnotherDatePicker revisited

Hi all,
I needed a way to highlight some "special" days on the calendar picker. They could be holidays or any other day reflecting a given condition. While I was at it, I preferred to differentiate between special days by their backgroud color. This last option let me, for example, show a day as "very busy" setting its background color to red, while a "not so critical day" could be yellow and so on.

So, I introduced a few (well documented) additions to Erel's original code and published here the modified class in case others should need something similar.

Note: this is the exact code (including demo) from the original ADP with only a few lines added.

udg
 

Attachments

  • dgADP.zip
    7.5 KB · Views: 391
Good afternoon people

I identified an error in the module, when I add a special date it is not taken into account, when analyzing the code of the module.
'### MISTAKE

B4A - ERROR:
Public Sub AddSpecialDate (DateTicks As Long)
If mlstSpecialDates.IndexOf (DateTime)[B] [/B]= -1 Then ' ERRO
mlstSpecialDates.Add (DateTime)' ERRO
End If
End Sub

'### CORRECTION

B4A - CORREÇÃO:
Public Sub AddSpecialDate (DateTicks As Long)
If mlstSpecialDates.IndexOf (DateTicks) = -1 Then
mlstSpecialDates.Add (DateTicks)
End If
End Sub

I would like to thank you because it helped me a lot! ;)
 

udg

Expert
Licensed User
Longtime User
Thank you, Adriano.
I had some hard time to find this class on my PC..probably beacuse it's somewhat old.
BTW, the version I found didn't sport sub AddSpecialDate so my copy should be even older than I recall. Anyway luckily there's the copy in this thread.. :)
 
Top