mirror of
https://github.com/fabrice404/olympics-calendar.git
synced 2026-02-25 03:27:08 +00:00
fix events uids
This commit is contained in:
4
index.js
4
index.js
@@ -109,13 +109,15 @@ const getTeamSport = async (sport) => {
|
||||
data.props.pageProps.page.items.find(item => item.name === "scheduleWrapper").data.schedules.forEach(schedule => {
|
||||
schedule.units.forEach(unit => {
|
||||
let title = `${getSportIcon(sport)} ${unit.description}`;
|
||||
let uid = `sport-${unit.startDateTimeUtc.replace(/[:-]/g, '')}`;
|
||||
|
||||
if (unit.match && unit.match.team1) {
|
||||
title = `${getSportIcon(sport)} ${countryNameAndFlag(unit.match.team1.description)} - ${countryNameAndFlag(unit.match.team2.description, true)}`;
|
||||
uid += `-${unit.match.team1.description.replace(/ /g, '-')}-${unit.match.team2.description.replace(/ /g, '-')}`;
|
||||
}
|
||||
|
||||
const event = {
|
||||
UID: unit.unitCode,
|
||||
UID: uid,
|
||||
DTSTAMP: unit.startDateTimeUtc.replace(/[:-]/g, ''),
|
||||
DTSTART: unit.startDateTimeUtc.replace(/[:-]/g, ''),
|
||||
DTEND: unit.endDateTimeUtc.replace(/[:-]/g, ''),
|
||||
|
||||
Reference in New Issue
Block a user