title: How to change the format of a date field in a jsgrid table
body: <p>Good afternoon, I have this data in a jsgrid table, the fact is that when the database returns the date when displaying it on the page it looks like this: / Date (1614232800000) / what I need is to convert it to DD format / MM / YYYY</p>
  <p>Reading the official documentation, there is by default a type of date field as such, but it is possible to modify parameters at will, that being the case, how can I convert the date?
  I read all from this, any idea, thank you.</p>
  <p><a href="http://js-grid.com/docs/#custom-field" rel="nofollow noreferrer">http://js-grid.com/docs/#custom-field</a></p>
  <p>First of all, Thanks.</p>
  <pre><code>var MyDateField = function (config) {
          jsGrid.Field.call(this, config);
      };
  
      MyDateField.prototype = new jsGrid.Field({
  
          css: &quot;date-field&quot;,            // redefine general property 'css'
          align: &quot;center&quot;,              // redefine general property 'align'
  
          myCustomProperty: &quot;itemTemplate&quot;,      // custom property
          itemTemplate: function (value) {
              return new Date(value).toDateString();
          }
      });
  
      jsGrid.fields.date = MyDateField;
  
  
  $('#dgrecordsfound').jsGrid({
    width: &quot;100%&quot;,
    height: &quot;350px&quot;,
    filtering: false,
    inserting: false,
    editing: false,
    sorting: true,
    paging: true,
    autoload:true,
    pageButtonCount: 5,
    noDataContent:&quot;No records!&quot;,
    loadIndication: true,
    loadMessage: &quot;Loading, Please wait&quot;,
  
    pagercontainer:null,
    pageIndex: 1,
    pageSize: 6,
    pageButtonCount: 15,
    pagerFormat: &quot;Pages: {first} {prev} {pages} {next} {last} &amp;nbsp;&amp;nbsp; {pageIndex} de {pageCount}&quot;,
    pagePrevText: &quot;Prev&quot;,
    pageNextText: &quot;Next&quot;,
    pageFirstText: &quot;First&quot;,
    pageLastText: &quot;Last&quot;,
    pageNavigatorNextText: &quot;...&quot;,
    pageNavigatorPrevText: &quot;...&quot;,
  
    controller: {
       loadData: function () {
          return $.ajax({
             type: &quot;GET&quot;,
             datatype: &quot;json&quot;,
             data: { parname: &quot;@ViewBag.name&quot;  , parlastname: &quot;@ViewBag.lastname&quot;},
             url: &quot;/asoc/getbyname&quot;
          });
       },
    },
  
    fields: [
       {
          name: &quot;cod&quot;,
          title: &quot;Code&quot;,
          type: &quot;text&quot;,
          width: 30
       },
       {
          name:&quot;firstname&quot;,
          title: &quot;firstname&quot;,
          type: &quot;text&quot;,
          width: 100
       },
       {
          name: &quot;date&quot;,
          title: &quot;Date&quot;,
          type: &quot;date&quot;,
           myCustomProperty: &quot;itemTemplate&quot;,
          width: 30
       }
    ],
  
    rowClick: function (itemselected) {
       var getdata = itemselected.item;
       var fields = Object.keys(getdata);
       var textarray = [];
  
       $.each(fields, function (idx, value) {
          textarray.push(getdata[value])
       });
  
       var url = '@Url.Action(&quot;index&quot;, &quot;request&quot;)' + '/id=1?parCod='+ textarray[1];
       window.location.href = url;
      }
  });
  </code></pre>