globalfunc.js 389 字节
Newer Older
S
StoneT2000 已提交
1
/* Wrap a callback, reduce code amount */
2
function wrapCB(callback, input) {
S
StoneT2000 已提交
3 4 5 6 7 8 9 10 11 12 13 14
  if (typeof callback === 'function') {
    callback(input);
  }
  return;
}
global.wrapCB = wrapCB;
function toTaosTSString(date) {
  date = new Date(date);
  let tsArr = date.toISOString().split("T")
  return tsArr[0] + " " + tsArr[1].substring(0, tsArr[1].length-1);
}
global.toTaosTSString = toTaosTSString;