futcal-for-scriptable
futcal-for-scriptable copied to clipboard
undefined is not an object
Now Futcal is not working since Fotmob API has slightly changed. To fix it, you need to follow below steps.
- 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(".", "")));
- 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
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 🔥
I think that the api changed slightly again! @hangoon-p
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.
Hey @hangoon-p, yes you're right it was fixed for me too after some days!
Thanks for your reply ☺️