mirror of
https://github.com/evroon/bracket.git
synced 2026-03-06 16:18:27 -05:00
Fix bug with null starttimes (#708)
This commit is contained in:
@@ -129,7 +129,8 @@ export function Schedule({
|
||||
|
||||
const matches: any[] = Object.values(matchesLookup);
|
||||
const sortedMatches = matches
|
||||
.sort((m1: any, m2: any) => (m1.match.court.name > m2.match.court.name ? 1 : -1))
|
||||
.filter((m1: any) => m1.match.start_time != null)
|
||||
.sort((m1: any, m2: any) => (m1.match.court?.name > m2.match.court?.name ? 1 : -1))
|
||||
.sort((m1: any, m2: any) => (m1.match.start_time > m2.match.start_time ? 1 : -1));
|
||||
|
||||
const rows: React.JSX.Element[] = [];
|
||||
@@ -137,7 +138,7 @@ export function Schedule({
|
||||
for (let c = 0; c < sortedMatches.length; c += 1) {
|
||||
const data = sortedMatches[c];
|
||||
|
||||
if (c < 1 || (data.match.start_time && sortedMatches[c - 1].match.start_time)) {
|
||||
if (c < 1 || sortedMatches[c - 1].match.start_time) {
|
||||
const startTime = formatTime(data.match.start_time);
|
||||
|
||||
if (c < 1 || startTime !== formatTime(sortedMatches[c - 1].match.start_time)) {
|
||||
|
||||
@@ -156,7 +156,8 @@ function Schedule({
|
||||
|
||||
const matches: any[] = Object.values(matchesLookup);
|
||||
const sortedMatches = matches
|
||||
.sort((m1: any, m2: any) => (m1.match.court.name > m2.match.court.name ? 1 : -1))
|
||||
.filter((m1: any) => m1.match.start_time != null)
|
||||
.sort((m1: any, m2: any) => (m1.match.court?.name > m2.match.court?.name ? 1 : -1))
|
||||
.sort((m1: any, m2: any) => (m1.match.start_time > m2.match.start_time ? 1 : -1));
|
||||
|
||||
const rows: React.JSX.Element[] = [];
|
||||
@@ -164,7 +165,7 @@ function Schedule({
|
||||
for (let c = 0; c < sortedMatches.length; c += 1) {
|
||||
const data = sortedMatches[c];
|
||||
|
||||
if (c < 1 || (data.match.start_time && sortedMatches[c - 1].match.start_time)) {
|
||||
if (c < 1 || (sortedMatches[c - 1].match.start_time)) {
|
||||
const startTime = formatTime(data.match.start_time);
|
||||
|
||||
if (c < 1 || startTime !== formatTime(sortedMatches[c - 1].match.start_time)) {
|
||||
|
||||
Reference in New Issue
Block a user