fixed timerange

This commit is contained in:
Davide Fantino 2022-09-20 21:38:06 +02:00
parent d62b6db612
commit 8c66119aa5

View File

@ -205,7 +205,7 @@ export default class MapVote extends DiscordBasePlugin {
const midnight = new Date(0, 0, 0, 0, 0) const midnight = new Date(0, 0, 0, 0, 0)
const tfEnd = new Date(0, 0, 0, ...tfEndSplit) const tfEnd = new Date(0, 0, 0, ...tfEndSplit)
const tfEnd2 = new Date(0, 0, 0, ...tfEndSplit) const tfEnd2 = new Date(0, 0, 0, ...tfEndSplit)
return (tfStart <= timeNow && timeNow < tfEnd) || (tfStart > tfEnd && ((tfStart <= timeNow && timeNow < midnight) || (midnight <= timeNow && timeNow < tfEnd)) return (tfStart <= timeNow && timeNow < tfEnd) || (tfStart > tfEnd && ((tfStart <= timeNow && timeNow < midnight) || (midnight <= timeNow && timeNow < tfEnd)))
} }
} }
async checkUpdates(callback) { async checkUpdates(callback) {