diff --git a/mapvote.js b/mapvote.js index 2db8a34..eec859e 100644 --- a/mapvote.js +++ b/mapvote.js @@ -202,9 +202,10 @@ export default class MapVote extends DiscordBasePlugin { const tfEndSplit = [ parseInt(tf.end.split(':')[ 0 ]), parseInt(tf.end.split(':')[ 1 ]) ]; const tfStart = new Date(0, 0, 0, ...tfStartSplit) - const tfStart2 = new Date(0, 0, 0, 0, 0) + const midnight = new Date(0, 0, 0, 0, 0) const tfEnd = new Date(0, 0, 0, ...tfEndSplit) - return (tfStart <= timeNow && timeNow < tfEnd) || (tfStart > tfEnd && ((tfStart <= timeNow || tfStart2 <= timeNow) && timeNow < tfEnd)) + const tfEnd2 = new Date(0, 0, 0, ...tfEndSplit) + return (tfStart <= timeNow && timeNow < tfEnd) || (tfStart > tfEnd && ((tfStart <= timeNow && timeNow < midnight) || (midnight <= timeNow && timeNow < tfEnd)) } } async checkUpdates(callback) {