1. Create a database with the events schema that you want to use to store events (see the definition below for adding an event to the calendar)
2. After loading the calendar on a page, i.e on the "oncreate" sub, call
B4X:
calendar.Clear(component)
To clear any entries that are on the calendar.
3. Then loop through all the items from your table and add each one with calendar.additem.
B4X:
Sub AddItem(eID As String, eCategory As String, eName As String, eStart As String, eEnd As String, eColor As String, eAllDay As Boolean, eLocation As String, eNote As String)
4. Call Refresh
B4X:
Sub Refresh(C As VueComponent)
This will get all the events you added from the "temporal" store and update the calendar UI.
2nd option
Create an events table with these "exact matching" field names ie. lowercase as per AddItem Subroutine above
B4X:
Sub AddItem(eID As String, eCategory As String, eName As String, eStart As String, eEnd As String, eColor As String, eAllDay As Boolean, eLocation As String, eNote As String)
Dim ne As Map = CreateMap()
ne.Put("id", eID)
ne.Put("name", eName)
ne.Put("start", eStart)
ne.Put("end", eEnd)
ne.Put("color", eColor)
ne.Put("timed", eAllDay)
ne.Put("category", eCategory)
ne.Put("note", eNote)
ne.Put("location", eLocation)
mEvents.Add(ne)
End Sub
Then after you get the list of events from the database, execute