handle dates more explicitly
This commit is contained in:
parent
0c63b20ffe
commit
2f2817897f
@ -18,11 +18,16 @@ export function handleRepeatingEvent(oldguildScheduledEvent: GuildScheduledEvent
|
||||
if (needsToBeRepeated(repetitionInfo)) {
|
||||
try {
|
||||
|
||||
const newDate = repetitionInfo.schedule.getNewDate(oldguildScheduledEvent.scheduledStartAt)
|
||||
if (repetitionInfo.endDate && (repetitionInfo.endDate <= newDate)) {
|
||||
console.log(`Wont repeat: EndDate: ${repetitionInfo.endDate} RepetitionDate: ${newDate}`)
|
||||
return
|
||||
}
|
||||
const newRepetitonString = buildNewRepetitionString(repetitionInfo)
|
||||
const newEventOptions: GuildScheduledEventCreateOptions = {
|
||||
name: oldguildScheduledEvent.name,
|
||||
description: addRepetitonStringToEventDescription(oldguildScheduledEvent.description, newRepetitonString),
|
||||
scheduledStartTime: repetitionInfo.schedule.getNewDate(oldguildScheduledEvent.scheduledStartAt),
|
||||
scheduledStartTime: newDate,
|
||||
privacyLevel: oldguildScheduledEvent.privacyLevel,
|
||||
entityType: oldguildScheduledEvent.entityType,
|
||||
channel: oldguildScheduledEvent.channel?.id,
|
||||
|
Loading…
Reference in New Issue
Block a user