mirror of
https://github.com/AsgardEternal/squad-js-map-vote.git
synced 2025-01-23 18:23:52 -06:00
fixed timerange
This commit is contained in:
parent
66c5245e37
commit
d62b6db612
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user