jQuery UI Widgets › Forums › Grid › Incorrect format of date
This topic contains 4 replies, has 2 voices, and was last updated by Peter Stoev 6 years, 1 month ago.
-
AuthorIncorrect format of date Posts
-
Good afternoon. I have a question.
I have Grid,which have some columns with type “date” and cellsformat: ‘dd.MM.yyyy’
Why If some object doesn’t have value (read null or empty value like “”), that cellsformat doesn’t work and date show like string( Sun Nov 17 2019 00:00:00 GMT+0300 (Саудовская Аравия, стандартное время)) ?
How I can to fix this problem?
Thanks a lot.Hi Zabelsky,
Have you tried setting nullable: true or false of your date column? It is also possible to customize the column rendering by handling the cellsrenderer column callback function.
Hope this helps.
Best Regards,
Peter StoevjQWidgets Team
https://www.jqwidgets.comHi,Peter.
I tried to use rendering by handling the cellrenderer column callback function,but that cellsformat didn`t work and return to cell the string like ( Sun Nov 17 2019 00:00:00 GMT+0300 (Саудовская Аравия, стандартное время)).but in function I was return the object.
But I didn`t try setting nullable.
Please,describe or give me example how to use setting nullable
Big thanks,Peter.
With best regards,
Alexey Zabelsky.{ text: "Visa", datafield: "_Visa", width: "16%", type: "date", cellsformat: 'dd.MM.yyyy', nullable: true }
Is it correctly?
Because I got http://prntscr.com/pedtgz (check screen,please)
Second try:
{ text: "Visa", datafield: "_Visa", width: "16%", type: "date", cellsformat: 'dd.MM.yyyy', nullable: true, cellsrenderer: rendd }
and rendd:var rendd = function (row, column, value) { if (value == null) { return true; } else return value; };but I got result like in the 1th attemp
Hi Zabelsky,
cellsrenderer overrides the cells rendering i.e cellsformat is not taken into account, when this is implemented. The value is a Date object i.e you can custom format it for your app’s needs.
Best Regards,
Peter StoevjQWidgets Team
https://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.