"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = cascadeTimestampRender;
var _errorRender = _interopRequireDefault(require("./errorRender"));
var _defaultRender = _interopRequireDefault(require("./defaultRender"));
var _formatter = _interopRequireDefault(require("../formatter"));
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 (0, _errorRender["default"])();
    }
    var start = _formatter["default"].date(cellData.start, timeFormatter);
    var end = _formatter["default"].date(cellData.end, timeFormatter);
    return (0, _defaultRender["default"])(start + " ~ " + end);
  }
  return (0, _errorRender["default"])();
}
;