all files / kayn/dist/lib/Utils/ DateTimeHelper.js

33.33% Statements 5/15
12.5% Branches 3/24
0% Functions 0/4
38.46% Lines 5/13
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29                                               
'use strict';
 
Object.defineProperty(exports, "__esModule", {
  value: true
});
 
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
 
var checkIfDateParam = function checkIfDateParam(tag) {
  return tag === 'beginTime' || tag === 'endTime';
};
 
var getEpoch = function getEpoch(time) {
  if (typeof time === 'string') {
    return new Date(0).setUTCMilliseconds(new Date(time));
  }
  if ((typeof time === 'undefined' ? 'undefined' : _typeof(time)) === 'object') {
    return new Date(0).setUTCMilliseconds(time);
  }
  if (typeof time === 'number') {
    return time;
  }
  return 0;
};
 
exports.default = {
  checkIfDateParam: checkIfDateParam,
  getEpoch: getEpoch
};