Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4792.js (118.4 MB)
65 lines
2.8 KiB
TypeScript
65 lines
2.8 KiB
TypeScript
// Module ID: 9795
|
|
// Function ID: 9796
|
|
// Name: saveGuildEventRecurrence
|
|
// Dependencies: [9758, 9796, 11, 2]
|
|
// Exports: default
|
|
|
|
// Module 9795 (saveGuildEventRecurrence)
|
|
import SnowflakeUtilsDefault from "SnowflakeUtils" /* 11 */;
|
|
import ScheduleUtils from "ScheduleUtils" /* 9758 */;
|
|
import GuildScheduledEventsActionCreatorsDefault from "GuildScheduledEventsActionCreators" /* 9796 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
let result = size.fileFinishedImporting("modules/guild_scheduled_events/saveGuildEventRecurrence.tsx");
|
|
|
|
export default function saveGuildEventRecurrence(guild_id, nextRecurrenceIdInEvent, startDate, event_exception_id) {
|
|
const baseScheduleForRecurrence = ScheduleUtils.getBaseScheduleForRecurrence(nextRecurrenceIdInEvent, guild_id);
|
|
startDate = null;
|
|
if (!obj2.areDatesIdentical(baseScheduleForRecurrence.startDate, startDate.startDate)) {
|
|
startDate = startDate.startDate;
|
|
}
|
|
obj2 = ScheduleUtils;
|
|
let endDate = null;
|
|
if (!tmpResult.areDatesIdentical(baseScheduleForRecurrence.endDate, startDate.endDate)) {
|
|
endDate = startDate.endDate;
|
|
}
|
|
if (null != event_exception_id) {
|
|
const result = tmp(9758).areSchedulesIdentical(startDate, baseScheduleForRecurrence);
|
|
const obj5 = GuildScheduledEventsActionCreatorsDefault;
|
|
if (result) {
|
|
let result1 = obj5.deleteGuildEventException(guild_id.guild_id, guild_id.id, event_exception_id.event_exception_id);
|
|
} else {
|
|
let toISOStringResult;
|
|
if (startDate != null) {
|
|
toISOStringResult = startDate.toISOString();
|
|
}
|
|
const obj3 = { scheduled_start_time: toISOStringResult, scheduled_end_time: null, is_canceled: null };
|
|
let toISOStringResult1;
|
|
if (endDate != null) {
|
|
toISOStringResult1 = endDate.toISOString();
|
|
}
|
|
obj3.scheduled_end_time = toISOStringResult1;
|
|
obj3.is_canceled = event_exception_id.is_canceled;
|
|
result1 = obj5.updateGuildEventException(obj3, guild_id.guild_id, guild_id.id, nextRecurrenceIdInEvent);
|
|
}
|
|
return result1;
|
|
} else {
|
|
const extractTimestampResult = SnowflakeUtilsDefault.extractTimestamp(nextRecurrenceIdInEvent);
|
|
const obj4 = { original_scheduled_start_time: null, scheduled_start_time: null, scheduled_end_time: null, is_canceled: false };
|
|
const _Date = Date;
|
|
const date = new Date(extractTimestampResult);
|
|
obj4.original_scheduled_start_time = date.toISOString();
|
|
let toISOStringResult2;
|
|
if (startDate != null) {
|
|
toISOStringResult2 = startDate.toISOString();
|
|
}
|
|
obj4.scheduled_start_time = toISOStringResult2;
|
|
let toISOStringResult3;
|
|
if (endDate != null) {
|
|
toISOStringResult3 = endDate.toISOString();
|
|
}
|
|
obj4.scheduled_end_time = toISOStringResult3;
|
|
return GuildScheduledEventsActionCreatorsDefault.createGuildEventException(obj4, guild_id.guild_id, guild_id.id);
|
|
}
|
|
tmpResult = ScheduleUtils;
|
|
};
|