trunc seconds when fitting tourney bars into lanes
parent
92027fce43
commit
d2114d7a6d
|
@ -71,12 +71,15 @@ function group(arr: Tournament[], grouper: (t: Tournament) => number): Lane[] {
|
|||
}
|
||||
|
||||
function truncSeconds(epoch: number): number {
|
||||
return epoch - (epoch % (60*1000));
|
||||
return epoch - (epoch % (60 * 1000));
|
||||
}
|
||||
|
||||
function fitLane(lane: Lane, tour2: Tournament) {
|
||||
return !lane.some(function (tour1: Tournament) {
|
||||
return !(truncSeconds(tour1.finishesAt) <= truncSeconds(tour2.startsAt) || truncSeconds(tour2.finishesAt) <= truncSeconds(tour1.startsAt));
|
||||
return !(
|
||||
truncSeconds(tour1.finishesAt) <= truncSeconds(tour2.startsAt) ||
|
||||
truncSeconds(tour2.finishesAt) <= truncSeconds(tour1.startsAt)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue