Sub Btn_Date_Click
'only CANCEL needed
Wait For (Dialog.ShowTemplate(DateTemplate, "", "", "CANCEL")) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
sDate = DateTime.GetYear(DateTemplate.Date) & "-" & _
NumberFormat(DateTime.GetMonth(DateTemplate.Date), 2, 0) & "-" & _
NumberFormat(DateTime.GetDayOfMonth(DateTemplate.Date), 2, 0)
Btn_Date.xLBL.Text = sDate
End If
End Sub
If user click on the date button (for calendar) and then clicks Cancel,
then on loading the calendar the second time, it allows user to change year to 2019 or 2031.
Each click on Cancel adds another year backward or forward.