Bug: Coda Doc Struggles to Sort by Date

I have a table that is grouped by date and sorted by date. Somehow, it’s not sorting the columns correctly. For example, in my table, you’ll find that rows with dates in May are not grouped together and scattered across the top, middle, and bottom of the table. You can also notice that rows with dates in July are improperly placed behind rows with dates in May.

Here’s a page you can view: Sort by Date Issue

hi @Isaac_Son
I don’t see what goes wrong and why, what I did was adding a column with this formula thisRow.DATE.month().Sort(True()) This will sort the dates properly.

and formatted the date to EU formatted values (but feel free to select any type)

hope it helps to move on, best christiaan

Dear @Isaac_Son,

I am rather sure that the content has been imported (copied) and not at once :thinking:

Although the dates are visual displayed correctly at the background Coda isn’t able to recognize them in the right way.

You could give a try to set the date in the standard USA format and then to switch the column to the text property.
Then copy the whole column and paste the content to a new column with the USA date format.
Then try to sort on this column and in many cases you should be good to go.

Please see this sample

Obviously the other column can be deleted.

I don’t know exactly what’s wrong because I examined the data closely and your dates get treated properly actually. However I can also see that the way dates are stored in Coda has changed lately: there’s much more metadata about a date value now than there used to be:

So I’m inclined to think that this is actually a bug. Best course of action is for you to ping Coda support through a chat in the bottom right of your Coda window and report the issue to them.

Making a separate column out of it that would calculate as DATE.ToDate() results in date values that are sorted properly though. So as a workaround yeah just make the second column that either takes the existing one and runs it through ToDate() or replace the values in the existing column in a similar way.

1 Like

Thank you all for responding to the thread!

I used all your suggestions and created a second column that converts the date to the “proper” date as a workaround.

I reached out to Coda support and they have verified that this is indeed a bug. Here’s a quote from one of their engineers (Steve):

“It seems to stem from the original format that the dates were entered. What I’m seeing is some of them are represented as just dates, and others are our version of ‘rich text’, with the text value being the date string. So when we sort, we are incorrectly sorting because we’re not seeing the values as the same.”

They have filed a ticket to the team, but have no timeline on when this will be fixed. But in the meantime, the workaround works fine for me! Thanks everyone.