• Edit
  • Download
  • <!DOCTYPE html>
    <html class="zg-html">
    
    <head>
      <meta charset="utf-8">
      <title>ZingGrid: Blank Grid</title>
      <script nonce="undefined" src="https://cdn.zinggrid.com/zinggrid.min.js"></script>
      <style>
        body {
          background: #e6e6e6;
        }
    
        zing-grid[loading] {
          height: 277px;
        }
      </style>
    </head>
    
    <body class="zg-body">
    
      <zing-grid caption="From Now" data='[
            { "first": "Maria", "last": "John", "number": "Apr 23 2015 08:50:20 GMT-0700" },
            { "first": "David", "last": "Smith", "number": "Apr 23 2020 08:11:20 GMT-0700" },
            { "first": "Felicity", "last": "Snow", "number": "Apr 23 2020 05:10:20 GMT-0700" }
          ]'>
        <zg-colgroup>
          <zg-column index="first"></zg-column>
          <zg-column index="last"></zg-column>
          <zg-column index="number" header="Raw" type="date" renderer="renderDateRaw"></zg-column>
          <zg-column index="number" header="Not Raw" type="date" renderer="renderDate"></zg-column>
        </zg-colgroup>
      </zing-grid>
    
      <script>
        ZingGrid.setLicense(['26ccbfec16b8be9ee98c7d57bee6e498']);
        let renderDateRaw = function(date) {
          return `${ZingGrid.fromNow(date, true)} too long`;
        };
        ZingGrid.registerMethod(renderDateRaw, 'renderDateRaw');
        let renderDate = function(date) {
          return ZingGrid.fromNow(date, false);
        };
        ZingGrid.registerMethod(renderDate, 'renderDate');
      </script>
    </body>
    
    </html>
    <!DOCTYPE html>
    <html class="zg-html">
    
    <head>
      <meta charset="utf-8">
      <title>ZingGrid: Blank Grid</title>
      <script src="https://cdn.zinggrid.com/zinggrid.min.js"></script>
    </head>
    
    <body class="zg-body">
    
      <zing-grid caption="From Now" data='[
            { "first": "Maria", "last": "John", "number": "Apr 23 2015 08:50:20 GMT-0700" },
            { "first": "David", "last": "Smith", "number": "Apr 23 2020 08:11:20 GMT-0700" },
            { "first": "Felicity", "last": "Snow", "number": "Apr 23 2020 05:10:20 GMT-0700" }
          ]'>
        <zg-colgroup>
          <zg-column index="first"></zg-column>
          <zg-column index="last"></zg-column>
          <zg-column index="number" header="Raw" type="date" renderer="renderDateRaw"></zg-column>
          <zg-column index="number" header="Not Raw" type="date" renderer="renderDate"></zg-column>
        </zg-colgroup>
      </zing-grid>
    
    </body>
    
    </html>
    body {
      background: #e6e6e6;
    }
    let renderDateRaw = function(date) {
      return `${ZingGrid.fromNow(date, true)} too long`;
    };
    ZingGrid.registerMethod(renderDateRaw, 'renderDateRaw');
    let renderDate = function(date) {
      return ZingGrid.fromNow(date, false);
    };
    ZingGrid.registerMethod(renderDate, 'renderDate');