ParamQuery grid support forum
General Category => Help for ParamQuery Grid (free version) => Topic started by: Eagle_f90 on January 22, 2016, 08:57:13 pm
-
I have a few dates to display in the grid that are coming from some JSON passed to the grid by my MVC6 backend. When the grid displays the date it is displayed in "2016-01-01T00:00:00". I would like to display it in for format of Jan. 01, 2016 00:00 A.M. Is this possible to do?
-
Use the formatDate function of jQueryUI
https://api.jqueryui.com/datepicker/#utility-formatDate
-
How would I apply that to the column?
-
use column.render
column.render = function( ui ){
var cellData = new Date( ui.cellData );
return $.datepicker.formatDate( 'required format', cellData );
}
If you also need to format time, then datetimepicker http://trentrichardson.com/examples/timepicker/ can be used in a similar way.
-
Hi, I do need to format the data but no examples from the linked site seem to work as they all work on an input box and I am not sure how to pass in the cell data for formatting. I have tried a few things but all of them break the grid. I can get the date format to work fine off the datepicker format example you gave just not the datetimepicker you linked.
obj.colModel[9].render = function (ui)
{
var cellData = new Date(ui.cellData);
return $.datetimepicker({ dateFormat: "yy-mm-dd", timeFormat: "hh:mm:ss" }, cellData);
}
-
Is formatting the time just not possible?