How to use the pn.date.fromMillis function in pn

To help you get started, we’ve selected a few pn examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PicNet / picnet_closure_repo / src / pn / json.js View on Github external
pn.json.parseJson = function(json) {
  if (!json) return null;
  pn.assStr(json);

  var regex = /\"[\\]+\/Date\((-?\d+(\+\d+)?)\)[\\]+\/\"/g;

  if (!window['pn.date.fromMillis'])
    window['pn.date.fromMillis'] = pn.date.fromMillis;

  var jsonDateSafe = json.replace(regex, 'window["pn.date.fromMillis"]($1)');
  return /** @type {!Object} */ (goog.json.unsafeParse(jsonDateSafe));
};
github PicNet / picnet_closure_repo / src / pn / json.js View on Github external
pn.json.parseJson = function(json) {
  if (!json) return null;
  pn.assStr(json);

  var regex = /\"[\\]+\/Date\((-?\d+(\+\d+)?)\)[\\]+\/\"/g;

  if (!window['pn.date.fromMillis'])
    window['pn.date.fromMillis'] = pn.date.fromMillis;

  var jsonDateSafe = json.replace(regex, 'window["pn.date.fromMillis"]($1)');
  return /** @type {!Object} */ (goog.json.unsafeParse(jsonDateSafe));
};