Using timePattern to change the default time format

Options

by Flexmonster Pivot Table

HTML

<link rel="stylesheet" href="https://s3.amazonaws.com/flexmonster/2.3/demo.css">
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>

<button onclick="exporter()">
Export both tables to Excel
</button>

<div style="width: 100%; float: none">
<div id="pivot-container"></div>
<div id="pivot-container2"></div>
</div>

CSS

div {
  float: left;
}

JavaScript

var pivot = new Flexmonster({
  container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  width: "50%",
  height: 430,
  report: {
    options: {
      "dateTimePattern": "GMT+0:yyyy-MM-dd HH:mm:ss",
      "grid": {
        "type": "compact",
        "showTotals": "off",
        "showGrandTotals": "off"
      }
    },
    "dataSource": {
      "data": getData(),
      "mapping": {
        "OrderDate": {
          "type": "datetime"
        },
        "Region": {
          "type": "string"
        },
        "Representative": {
          "type": "string"
        },
        "Item": {
          "type": "string"
        },
        "Units": {
          "type": "number"
        },
        "UnitCost": {
          "type": "number"
        }
      }
    },
    "slice": {
      "rows": [{
        "uniqueName": "OrderDate"
      }],
      "columns": [{
        "uniqueName": "Region"
      }],
      "measures": [{
        "uniqueName": "Units",
        "aggregation": "sum"
      }]
    }
  }
});

var pivot2 = new Flexmonster({
  container: "pivot-container2",
  componentFolder: "https://cdn.flexmonster.com/",
  width: "50%",
  height: 430,
  report: {
    options: {
      "dateTimePattern": "GMT+0:yyyy-MM-dd HH:mm:ss",
      "grid": {
        "type": "compact",
        "showTotals": "off",
        "showGrandTotals": "off"
      }
    },
    "dataSource": {
      "data": getData(),
      "mapping": {
        "OrderDate": {
          "type": "datetime"
        },
        "Region": {
          "type": "string"
        },
        "Representative": {
          "type": "string"
        },
        "Item": {
          "type": "string"
        },
        "Units": {
          "type": "number"
        },
        "UnitCost": {
          "type": "number"
        }
      }
    },
    "slice": {
      "rows": [{
        "uniqueName": "[Measures]"
      }],
      "columns": [{
        "uniqueName": "Region"
      }],
      "measures": [{
        "uniqueName":...