feat: recover nightwave challenges #2593
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "AMelonInsideLemon/SpaceNinjaServer:getPastWeeklyChallenges"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #1534
@ -454,0 +442,4 @@
const nightwaveStartDate = new Date(nightwaveStartTimestamp);
const dayOffset = (nightwaveStartDate.getDay() + 6) % 7;
nightwaveStartDate.setDate(nightwaveStartDate.getDate() - dayOffset);
nightwaveStartDate.setHours(0, 0, 0, 0);
This is dependent on local time.
In general, you should be able to divide by 7 days, that's what the EPOCH is for. Otherwise, looks good.
You are talking about that offset inside
nightwaveWeekStart
?Yes, I don't see why you don't just use the existing logic to operate on the timestamp itself.
Right now the Nightwave start date falls on Wednesday, but the rotation of challanges is Monday. And for this I move the
nightwaveStartDate
to Monday to get correct timestamp to calculate nightwave week number.Modular arithmetic, my man.