mirror of
https://github.com/TheRealOwenRees/echecsfrance.git
synced 2026-07-22 20:16:57 +00:00
Fix the tournament result search (#249)
This commit is contained in:
@@ -27,6 +27,8 @@ export const addTournament = publicProcedure
|
||||
const tournamentData: Omit<TournamentData, "_id" | "tournament_id"> = {
|
||||
...tournament,
|
||||
date: format(tournament.date, "dd/MM/yyyy"),
|
||||
start_date: format(tournament.date, "dd/MM/yyyy"),
|
||||
end_date: format(tournament.date, "dd/MM/yyyy"),
|
||||
time_control: tcMap[tournament.time_control],
|
||||
coordinates: tournament.coordinates as [number, number],
|
||||
entry_method: "manual",
|
||||
|
||||
@@ -47,7 +47,7 @@ export const searchTournaments = publicProcedure
|
||||
$addFields: {
|
||||
dateParts: {
|
||||
$dateFromString: {
|
||||
dateString: "$end_date",
|
||||
dateString: "$start_date",
|
||||
format: "%d/%m/%Y",
|
||||
},
|
||||
},
|
||||
@@ -83,7 +83,7 @@ export const searchTournaments = publicProcedure
|
||||
tournament: t.tournament,
|
||||
town: t.town,
|
||||
department: t.department,
|
||||
date: t.date,
|
||||
date: t.start_date,
|
||||
url: t.url,
|
||||
timeControl,
|
||||
status: t.status,
|
||||
|
||||
@@ -14,6 +14,8 @@ export const tournamentDataSchema = z.object({
|
||||
time_control: z.string(),
|
||||
norm_tournament: z.boolean().optional(),
|
||||
date: z.string(),
|
||||
start_date: z.string(),
|
||||
end_date: z.string(),
|
||||
coordinates: z.array(z.number()).min(2).max(2),
|
||||
entry_method: z.enum(["manual", "auto"]),
|
||||
pending: z.boolean().optional(),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { clamp, last } from "lodash";
|
||||
|
||||
// Fide uses teh following table to establish the chance of winning based on the difference in elo.
|
||||
// Fide uses the following table to establish the chance of winning based on the difference in elo.
|
||||
// https://handbook.fide.com/chapter/B022017
|
||||
|
||||
const differenceToProbability: [
|
||||
|
||||
Reference in New Issue
Block a user