Component to simplify date input
Added change event
B4X:
' create the component
Dim edit_date1 As xnEditDate
edit_date1.Initialize("edit1_date")
Activity.AddView ( edit_date1 , 0dip , 105dip , 180dip , 40dip )
' setting and getting the value
Dim now As Long
now = DateTime.now
edit_date1.DateAsLong = now
now = edit_date1.DateAsLong
Msgbox ( "The date is: " & DateTime.Date(now) & CRLF & "The time is: " & DateTime.Time(now) , "" )
edit_date1.DateAsSql = "20120514"
now = edit_date1.DateAsLong
Msgbox ( "The date is: " & DateTime.Date(now) & CRLF & "The time is: " & DateTime.Time(now) , "" )
Added change event
B4X:
Sub edit_date1_change
MsgBox ( edit_date1.DateAsSql , "Change" )
End Sub
Attachments
Last edited: