B4J Question B4XDateTemplate BUG??

IndieDev

Active Member
Licensed User
Hi,

In Process Globals, I've declared:
B4X:
Private DateTemplate As B4XDateTemplate

In AppStart, I've set:
B4X:
    DateTemplate.MinYear = 2020
    DateTemplate.MaxYear = 2030

In Button click event, i've set:
B4X:
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.

Is this intended function or a bug?

Thanks and regards,
 
Top