shadcn table
Unanswered
Netherland Dwarf posted this in #help-forum
Netherland DwarfOP
I can't figure out why I can sort by creationdate but if I sort by lastlogin the entire ui break, here is the code
8 Replies
Netherland DwarfOP
IP section gets wiped and login section is full of NaN
Tramp ant
Whats your table sorting function?
Also you should look into
date.toLocaleDateString@Tramp ant Whats your table sorting function?
Netherland DwarfOP
I guess it's the defautl since I did not modify it
@Tramp ant Also you should look into `date.toLocaleDateString`
Netherland DwarfOP
Once I use toLocaleDateString I get the following errors inside the console :
Warning: An error occurred during hydration. The server HTML was replaced with client content in <#document>.
Uncaught Error: Text content does not match server-rendered HTML.
Uncaught Error: There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.@Tramp ant Whats your table sorting function?
Netherland DwarfOP
The issue is creationdate and lastlogin both use timestamps and and only lastlogin breaks the table
@Netherland Dwarf Once I use toLocaleDateString I get the following errors inside the console : Warning: An error occurred during hydration. The server HTML was replaced with client content in <#document>.
Uncaught Error: Text content does not match server-rendered HTML.
Uncaught Error: There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.
Netherland DwarfOP
When I reload, I can see the date changing from mm/dd/yy to dd/mm/yy and I don't know why
Netherland DwarfOP
Looks like it was related to some weird value in my db