'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var isUdf = _interopDefault(require('./isUdf'));
var getDayStartTime = _interopDefault(require('./getDayStartTime'));
var consts = require('./consts');

/**
 * 获取一天的结束时间，23点59分59秒时间戳
 * @param {Date|number|string} time
 * @returns {number}
 *
 * getDayEndTime('2021-10-01'); // => 1633103999999
 */
function getDayEndTime(time) {
  if (isUdf(time)) time = new Date();
  var startTime = getDayStartTime(time);
  if (!startTime) return NaN;
  return startTime + consts.DAY_TIME_1;
}

module.exports = getDayEndTime;
