Skip to content

Commit

Permalink
fixed unable to read airing episode
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivaBhattacharjee committed Aug 24, 2023
1 parent d1ad5a6 commit a57ab16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/details/[animeId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default async function page({ params }: {
<ServerError />
);
}
const airingDate = new Date(details.nextAiringEpisode.timeUntilAiring * 1000);
const airingDate = new Date(details?.nextAiringEpisode?.timeUntilAiring * 1000);
const options: Intl.DateTimeFormatOptions = {
year: undefined,
month: 'long',
Expand Down Expand Up @@ -81,7 +81,7 @@ export default async function page({ params }: {
</div>}>
{details.nextAiringEpisode !== undefined && (
<h1 className='bg-white text-black lg:w-96 w-full text-xl font-bold text-center p-3 rounded-lg'>
Episode {details?.nextAiringEpisode?.episode} will at {formattedAiringDate}
Episode {details?.nextAiringEpisode?.episode} will air in {formattedAiringDate}
</h1>
)}
<EpisodeLists listData={details.episodes} />
Expand Down

0 comments on commit a57ab16

Please sign in to comment.