I added a calendar object with the default view to MONTH, for some reason when I click on any of the days the _DayClicked(date As String) does not fire up, below is the code where I initialize the object.
and here are the events that are supposed to fire up when clicking on any day.
Calendar Events:
Sub calendar1_DayClicked(date As String)
Log("date clicked: " & date)
End Sub
Sub calendar1_EventClicked(eventId As String)
Log("event clicked: " & eventId)
End Sub
Sub calendar1_FetchData(dateStart As String, dateEnd As String)
Log("fetchData: " & dateStart & " / " & dateEnd)
End Sub
Is this a bug or am I missing something here?
I noticed that on the Demo the ABMaterial version 4.3 is being used and when testing on the Demo project, the _DayClicked(date As String) events gets raised just fine, I started working on my project with the latest version so I can't just go back to version 4.3.
It seems the problem is because I am adding the calendar object inside a container, basically I have an ABMTab component, on the first tab's container I add the ABMCalendar object, I just tried adding the ABMCalendar object to the page, like this "Page.cell(1,1).addComponent(calendar)" and the click event works fine, but when I move the calendar back to the Tab's container then the click event stops working.
I just realized also that the calendar object doesn't obey the default date setting, for example I set the default to be 2024-04-12, April 12th 2024 and it doesn't obey that setting.
So it seems that I would need to change the calendar Click event to that, but if I try to do that I get an error telling me the function signature is wrong.
Why is the eventName returning the calendar's parent name, it doesn't do this on previous versions.
For now, I added this code at the top of the Page_ParseEvent( params As Map) function to catch the calendar event name, it works this way but hopefully @alwaysbusy can take a look and fix the issue.
B4X:
Dim group() As String
If eventName == "containertab1-calendar1_dayclicked" Then
group = Regex.Split("-", eventName) '' split eventName at dash "-"
eventName = group(1).Trim ''' get the second line after splitting which should be calendar1_dayclicked
End If