import errorRender from "./errorRender";
import defaultRender from "./defaultRender";
import Formatter from "../formatter";
export default function cascadeTimestampRender(cellData, item) {
  if (!cellData) {
    return '';
  }
  var timeFormatter = item.timeFormatter;
  if (Object.prototype.toString.call(cellData) === '[object Object]') {
    if (!cellData.hasOwnProperty('start') && !cellData.hasOwnProperty('end')) {
      return errorRender();
    }
    var start = Formatter.date(cellData.start, timeFormatter);
    var end = Formatter.date(cellData.end, timeFormatter);
    return defaultRender(start + " ~ " + end);
  }
  return errorRender();
}
;