Android Question B4XTable Column_Type_Date Display a Null Date

Antonio Ferreira

Member
Licensed User
Longtime User
I insert column values in a B4xtable Column_type_Date with ticks.
When insert a value = 0 or null I always have 01-01-1970 on the B4xtable column value.
How display a empty column date value when the date is null ?
 

toby

Well-Known Member
Licensed User
Longtime User
B4X:
B4XTable1.AddColumn("MyDateTime", B4XTable1.COLUMN_TYPE_TEXT)
dim ticks as long

For Each colroot As Map In root
    Dim cols(colroot.Size) As Object
    ticks=colroot.Get("MyDateTime")
    If cols(0)=Null or cols(0)=0 Then
        cols(0)=""
    else
        cols(0)=DateTime.Date(ticks)
    end if              
next
 
Upvote 0

Antonio Ferreira

Member
Licensed User
Longtime User
I use the B4XTable1.COLUMN_TYPE_DATE for display dates, for sorting correctly the B4xtable column when i use the display date format "dd-mm-yyyyy"
If i use the B4XTable1.COLUMN_TYPE_TEXT i can´t sort B4xtable column with this date format, when i click on the header column

Thanks for your help
 
Upvote 0
Top