Running Ignition 8.0.6, we have a table with a column full of timestamps. We set the columns.render property to "date" and sortable to true. When we sort the date column, it seems to be sorting based on the string-formatted time rather than the actual timestamp.
For example, if I had the dateFormat set to "MM/DD/YYYY" and sorted by date, I might see these items in this order:
12/16/2019
12/06/2019
01/05/2020
Note that the "12/06/2019" entry is out of order, I suspect because '0' comes after '2' in string ASCII sorting. Even worse, I suspect that if I had another entry from January of 2019, it would show up adjacent to the Januar 2020 entry instead of at the beginning.
I expected the items to be sorted in chronological order.
I sent in an email to Inductive Support and if you render the column as âautoâ instead of date the sorting works correctly. I donât think itâs being dealt with as a bug just as designed.
âDo you want sort or do you want stupid format? You canât have both. You know why the rest of the world uses YYYY/MM/DD? This is why. Whatâs the deal with imperial measurement anywayâwho the hell thought base 12 was a good idea? And donât get me started on our healthcare-â âOkay, sure, I can do it wrong if thatâs what you want but like I said they wonât sort.â âOh you donât care that much just get it done? 10-4â
Ignition version 8.1.6 contains several bug fixes which had impacted the sorting of Table columns, including the ability to sort a column by date. In 8.1.6 and newer versions, you should find that timestamps and string dates sort appropriately. Please reply in this thread with any feedback or concerns while using 8.1.6 or newer.
Maybe part of the problem is at least in my case there are null values in some of the rows. However, I would still expect it to sort the non null values correctly.
Is there anyway you could provide a mock up reproducing the issue so I can give it a look. I tried reproducing it with a dataset tag as well as trying to mimic your data structure without success. Thanks.
Ok, cool. I just reproduced it in a view as well. (See attached). I made a dummy DB (MSSQL) query to generate some random dates and am able to replicate the issue consistently.
strangely, on some views with the same column configuration sorting on dates values seems to work.
I have an example with rows from the audit_logs SQL table that sorts correctly into the perspective table.
Since Iâve installed the 8.1.10 version, I notice that sometimes the cells of columns with a width=0 appears on my Table.
When I inspect the Source code, I notice that the style is correct in class="tc ia_table__cell ia_table__head__header__cell thc sortable" : style="order: 3; width: 0px; flex: 0 1 auto; max-width: 0px;" but not on table body : class="tc ia_table__cell" : style="order: 3;"
Itâs happening on the firt loading of the view.
Hello,
the common format for our country is: dd.mm.yyyy unfortunately sort does not work in version 8.1.9 (it is sorted as string not the chronological date).