"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDefaultEventDatesAndTimes = void 0;
const getDatePickerDate_1 = require("../../utils/date/getDatePickerDate");
const getTimePickerTime_1 = require("../../utils/date/getTimePickerTime");
const guessTimeZone_1 = require("../../utils/date/guessTimeZone");
/**
 * @private
 * Builds an object containing the user's guessed timezone and default
 * event start/end dates and times
 */
const getDefaultEventDatesAndTimes = () => {
    const hour = 1000 * 60 * 60;
    const nowPlus1Hour = new Date(Date.now() + hour);
    const nextFullHour = new Date(nowPlus1Hour.getFullYear(), nowPlus1Hour.getMonth(), nowPlus1Hour.getDate(), nowPlus1Hour.getHours());
    const sDate = nextFullHour.toISOString();
    const eDate = new Date(nextFullHour.valueOf() + hour).toISOString();
    const timeZone = (0, guessTimeZone_1.guessTimeZone)();
    const startDate = (0, getDatePickerDate_1.getDatePickerDate)(sDate, timeZone);
    const endDate = (0, getDatePickerDate_1.getDatePickerDate)(eDate, timeZone);
    return {
        startDate,
        startDateTime: new Date(sDate),
        startTime: (0, getTimePickerTime_1.getTimePickerTime)(sDate, timeZone),
        endDate,
        endDateTime: new Date(eDate),
        endTime: (0, getTimePickerTime_1.getTimePickerTime)(eDate, timeZone),
        timeZone,
    };
};
exports.getDefaultEventDatesAndTimes = getDefaultEventDatesAndTimes;
//# sourceMappingURL=getDefaultEventDatesAndTimes.js.map