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