futcal-for-scriptable icon indicating copy to clipboard operation
futcal-for-scriptable copied to clipboard

undefined is not an object

Open hangoon-p opened this issue 2 years ago • 4 comments

Now Futcal is not working since Fotmob API has slightly changed. To fix it, you need to follow below steps.

  1. Find the code to modify at around Line 299.
               const detailsDateValue = formatDate(new Date((matchDetails.content.matchFacts.infoBox["Match Date"].dateFormatted).replaceAll(".", "")));
                addFormattedText(matchInfoDetailsStack, detailsDateValue, Font.regularSystemFont(12), Color.gray(), null, false);
                matchInfoDetailsStack.addSpacer(3);
                const detailsTimeValue = formatTime(new Date((`${matchDetails.content.matchFacts.infoBox["Match Date"].dateFormatted} ${matchDetails.content.matchFacts.infoBox["Match Date"].timeFormatted}`).replaceAll(".", "")));
  1. Replace it to below
                const detailsDateValue = formatDate(new Date((matchDetails.content.matchFacts.infoBox["Match Date"].utcTime)));
                addFormattedText(matchInfoDetailsStack, detailsDateValue, Font.regularSystemFont(12), Color.gray(), null, false);
                matchInfoDetailsStack.addSpacer(3);
                const detailsTimeValue = formatTime(new Date((`${matchDetails.content.matchFacts.infoBox["Match Date"].utcTime}`)));

There's nothing difficult. It's just analyzing returned JSON data.

@beratgashi

hangoon-p avatar Dec 13 '22 01:12 hangoon-p

Thank you @hangoon-p it worked perfectly I don't know where are you checking this codes to find the fix this fast!

Thank you very much man 🔥

beratgashi avatar Dec 13 '22 08:12 beratgashi

I think that the api changed slightly again! @hangoon-p

beratgashi avatar Apr 02 '23 01:04 beratgashi

I think that the api changed slightly again! @hangoon-p

Hello @beratgashi After your message I have observed but mine is Okay until now. If you are having a trouble, I recommend you to re-install the script.

hangoon-p avatar Apr 10 '23 10:04 hangoon-p

Hey @hangoon-p, yes you're right it was fixed for me too after some days!

Thanks for your reply ☺️

beratgashi avatar Apr 10 '23 10:04 beratgashi