68 lines
2.8 KiB
TypeScript
68 lines
2.8 KiB
TypeScript
// Module ID: 8154
|
|
// Function ID: 65390
|
|
// Name: _getEventSchedule
|
|
// Dependencies: [5751, 8148, 8153, 566, 2]
|
|
// Exports: default, getEventSchedule, useEventScheduleById
|
|
|
|
// Module 8154 (_getEventSchedule)
|
|
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
|
|
|
|
const require = arg1;
|
|
function _getEventSchedule(stateFromStores, eventException, nextRecurrenceIdInEvent) {
|
|
let endDate;
|
|
let startDate;
|
|
if (null != stateFromStores.recurrence_rule) {
|
|
if (null != nextRecurrenceIdInEvent) {
|
|
let toDateResult;
|
|
let obj = require(8148) /* getNextBucketedTime */;
|
|
const baseScheduleForRecurrence = obj.getBaseScheduleForRecurrence(nextRecurrenceIdInEvent, stateFromStores);
|
|
const scheduleForRecurrenceWithException = require(8148) /* getNextBucketedTime */.getScheduleForRecurrenceWithException(baseScheduleForRecurrence, eventException);
|
|
({ startDate, endDate } = scheduleForRecurrenceWithException);
|
|
obj = { startTime: startDate.toDate() };
|
|
if (null != endDate) {
|
|
toDateResult = endDate.toDate();
|
|
}
|
|
obj.endTime = toDateResult;
|
|
return obj;
|
|
}
|
|
}
|
|
obj = { startTime: new Date(stateFromStores.scheduled_start_time) };
|
|
let date1 = null;
|
|
if (null != stateFromStores.scheduled_end_time) {
|
|
const _Date = Date;
|
|
date1 = new Date(stateFromStores.scheduled_end_time);
|
|
}
|
|
obj.endTime = date1;
|
|
return obj;
|
|
}
|
|
const result = require("_getEventException").fileFinishedImporting("modules/guild_scheduled_events/useEventSchedule.tsx");
|
|
|
|
export default function useEventSchedule(id, nextRecurrenceIdInEvent) {
|
|
if (null == nextRecurrenceIdInEvent) {
|
|
nextRecurrenceIdInEvent = require(8148) /* getNextBucketedTime */.getNextRecurrenceIdInEvent(id);
|
|
const obj = require(8148) /* getNextBucketedTime */;
|
|
}
|
|
return _getEventSchedule(id, importDefault(8153)(nextRecurrenceIdInEvent, id.id), nextRecurrenceIdInEvent);
|
|
};
|
|
export const useEventScheduleById = function useEventScheduleById(guildEventId, recurrenceId) {
|
|
let nextRecurrenceIdInEvent = recurrenceId;
|
|
const _require = guildEventId;
|
|
const items = [_isNativeReflectConstruct];
|
|
const stateFromStores = _require(566).useStateFromStores(items, () => outer1_3.getGuildScheduledEvent(closure_0));
|
|
if (null == recurrenceId) {
|
|
nextRecurrenceIdInEvent = _require(8148).getNextRecurrenceIdInEvent(stateFromStores);
|
|
const obj2 = _require(8148);
|
|
}
|
|
importDefault(8153);
|
|
if (null != stateFromStores) {
|
|
const id = stateFromStores.id;
|
|
}
|
|
let tmp7 = null;
|
|
if (null != stateFromStores) {
|
|
tmp7 = _getEventSchedule(stateFromStores, tmp6, nextRecurrenceIdInEvent);
|
|
}
|
|
return tmp7;
|
|
};
|
|
export const getEventSchedule = function getEventSchedule(guildEvent, recurrenceId) {
|
|
return _getEventSchedule(guildEvent, require(8153) /* _getEventException */.getEventException(recurrenceId, guildEvent.id), recurrenceId);
|
|
};
|