Android Question B4XDateTemplate show multiple selected date

imak123

Member
I tried to create calendar to show the event dates and allow client to click the date to apply for the event.
I have used dateTemplate to create a calendar, however I could only show one selected event date. How could I add more than one event dates to show in the calendar... Thanks for all your help.
Mak
DateTemplate:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    DateTime.DateFormat = "dd/MM/yyyy"
    dialog.Initialize(Root)
    D.Initialize
    
    Dim targetDate As String = "13/09/2023"
    Dim targetDate2 As String = "21/09/2023"
            
    Dim longDate As Long = DateTime.DateParse(targetDate)
    
    
    Log(longDate)
    D.Date = longDate
    [ATTACH type="full"]145447[/ATTACH]
    
    D.SelectedColor = xui.color_Red
    
    
    dialog.Title="calendar"
    
    
    Wait for (dialog.ShowTemplate(D,"ok","","cancel")) complete(result As Int)
    If result = xui.DialogResponse_Positive Then
        'Set the date format
        'DateTime.DateFormat = "dd/MM/yyyy"
        'conver the long date format to custom format
        If D.Date = longDate Then
            Log("WE have event")
        End If
        
        'Log(DateTime.Date(D.Date))
    End If
    
End Sub
 

Attachments

  • B4A.jpg
    B4A.jpg
    63.6 KB · Views: 39

Alexander Stolte

Expert
Licensed User
Longtime User
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
 
Upvote 0
Top