Skip to content

Commit bff7638

Browse files
committed
Update date props
1 parent 6fd3c07 commit bff7638

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/hooks/calendar.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,13 @@ function getDateProps(
130130
const day = newDate.getDate().toString();
131131
const year = newDate.getFullYear().toString();
132132

133-
newDate.setDate(newDate.getDate() - 1);
134-
135133
const newDate2 = new Date(date2);
136134
newDate2.setHours(newDate2.getHours());
137135
const month2 = (newDate2.getMonth() + 1).toString();
138136
const day2 = newDate2.getDate().toString();
139137
const year2 = newDate2.getFullYear().toString();
140138

141-
console.log(event, newDate, newDate2);
139+
console.log("CHECKING DATE PROPS:", event, newDate, newDate2);
142140

143141
// Set start and end to times, and include the date
144142
if (
@@ -170,13 +168,8 @@ function getDateProps(
170168

171169
// Function to create discord event
172170
async function createDiscordEvents(events: Messages[], client: Client) {
173-
// Filter out all events that are not next week
174-
const nextWeekEvents = events.filter(
175-
(event) => event.range === "Next Week"
176-
);
177-
178171
// Iterate through the next week events
179-
nextWeekEvents.map(async (event) => {
172+
events.map(async (event) => {
180173
// Create a guild event for each event using the discord client
181174
for (const guild of client.guilds.cache.values()) {
182175
try {
@@ -413,7 +406,7 @@ export async function execute(client: Client) {
413406

414407
try {
415408
// Check events on a schedule
416-
cron.schedule("30 9 * * *", async () => hookLogic(client, preWebhook));
409+
cron.schedule("30 11 * * *", async () => hookLogic(client, preWebhook));
417410
cron.schedule("0 12 * * *", async () => hookLogic(client, webhook));
418411
// Catch any errors
419412
} catch (err: unknown) {

0 commit comments

Comments
 (0)