diff --git a/public/covers/NZiAc-mIJuQ/cover.webp b/public/covers/NZiAc-mIJuQ/cover.webp index b96da468..862523f7 100644 Binary files a/public/covers/NZiAc-mIJuQ/cover.webp and b/public/covers/NZiAc-mIJuQ/cover.webp differ diff --git a/public/covers/PLRfhDHeBTBJ4GoSaMs-BqHumiPqUHU3OX/cover.webp b/public/covers/PLRfhDHeBTBJ4GoSaMs-BqHumiPqUHU3OX/cover.webp index 67f41dda..5a96590c 100644 Binary files a/public/covers/PLRfhDHeBTBJ4GoSaMs-BqHumiPqUHU3OX/cover.webp and b/public/covers/PLRfhDHeBTBJ4GoSaMs-BqHumiPqUHU3OX/cover.webp differ diff --git a/public/covers/PLRfhDHeBTBJ6PHF-BH9dFug86rb877o2y/cover.webp b/public/covers/PLRfhDHeBTBJ6PHF-BH9dFug86rb877o2y/cover.webp new file mode 100644 index 00000000..b9a92dde Binary files /dev/null and b/public/covers/PLRfhDHeBTBJ6PHF-BH9dFug86rb877o2y/cover.webp differ diff --git a/src/actions/planning.js b/src/actions/planning.js index e52c709a..cd8f69be 100644 --- a/src/actions/planning.js +++ b/src/actions/planning.js @@ -42,15 +42,22 @@ export const get_scheduled_games = () => { "status": scheduledGame.status || (scheduledGame.hasOwnProperty("endAt") ? "RECORDED" : "PENDING") }; - const releaseDate = scheduledGame?.availableAt.toString(); - if ( releaseDate.match(intergerDateRegex)) { - const { year, month, day } = intergerDateRegex.exec(releaseDate).groups; - return { - ...common, - "releaseDate": new Date(+year, month - 1, +day) - } - } else { - return common; + // optional date fields + const optional = [ + ["releaseDate", scheduledGame?.availableAt?.toString()], + ["endDate", scheduledGame?.endAt?.toString()] + ] + .filter( field => !!field[1] && field[1].match(intergerDateRegex) ) + .reduce( (acc, curr) => { + const [key, value] = curr; + const { year, month, day } = intergerDateRegex.exec(value).groups; + acc[key] = new Date(+year, month - 1, +day); + return acc; + }, {}); + + return { + ...common, + ...optional } }); diff --git a/src/components/Planning/PlanningColumns.js b/src/components/Planning/PlanningColumns.js index e2a83151..160aea9f 100644 --- a/src/components/Planning/PlanningColumns.js +++ b/src/components/Planning/PlanningColumns.js @@ -44,11 +44,23 @@ const planningColumns = (t, date_options, language) => [ headerAlign: 'center', renderCell: (params) => ( <> - {params.value.toLocaleDateString(language, date_options)} + {params?.value?.toLocaleDateString(language, date_options)} ), width: 220 }, + { + field: "endDate", + headerName: t("planning.columns.endDate"), + headerAlign: 'center', + renderCell: (params) => ( + <> + {params?.value?.toLocaleDateString(language, date_options)} + + ), + width: 220, + hide: true + }, { field: "status", headerName: t("planning.columns.status"), diff --git a/src/data/games.json b/src/data/games.json index 672fa32a..cfdcfe1d 100644 --- a/src/data/games.json +++ b/src/data/games.json @@ -1764,6 +1764,20 @@ "availableAt":20230714, "endAt":20230714, "coverFile": "cover.webp" + }, + { + "title": "Afro Samurai", + "playlistId": "PLRfhDHeBTBJ6PHF-BH9dFug86rb877o2y", + "releaseDate": "27/03/2009", + "duration": "04:46:22", + "genres": [ + "Action", + "Fighting" + ], + "platform": "PS3", + "availableAt":20230717, + "endAt":20230802, + "coverFile": "cover.webp" } ] } \ No newline at end of file diff --git a/src/translations/en/common.json b/src/translations/en/common.json index f29dfeee..64aae085 100644 --- a/src/translations/en/common.json +++ b/src/translations/en/common.json @@ -80,6 +80,7 @@ "columns": { "title": "Title", "releaseDate": "Release Date", + "endDate": "End Date", "status": "Status", "platform": "Platform" } diff --git a/src/translations/fr/common.json b/src/translations/fr/common.json index a9d128d3..ff45dd8a 100644 --- a/src/translations/fr/common.json +++ b/src/translations/fr/common.json @@ -80,6 +80,7 @@ "columns": { "title": "Titre", "releaseDate": "Date de sortie", + "endDate": "Date de fin", "status": "Statut", "platform": "Plateforme" }