Finish gist

This commit is contained in:
2020-10-17 01:20:51 +02:00
parent e4186457e2
commit cb01b7bcb7
51 changed files with 155 additions and 132281 deletions
@@ -1,11 +1,14 @@
package de.jeyp91.tippliga;
import com.google.api.client.util.DateTime;
import de.jeyp91.TeamIDMatcher;
import de.jeyp91.apifootball.APIFootballMatch;
import de.jeyp91.apifootball.APIFootballMatchesProvider;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Date;
@@ -133,7 +136,13 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase {
{
for(APIFootballMatch apiFootballMatch : apiFootballMatches) {
TLWMatch tlwMatch = getMatchingMatch(apiFootballMatch, tlwMatches);
tlwMatch.setMatchDateTime(apiFootballMatch.getMatchDateTime().replace("T", " ").substring(0, 19));
OffsetDateTime offsetDateTime = OffsetDateTime.parse(apiFootballMatch.getMatchDateTime());
ZonedDateTime now = ZonedDateTime.now();
ZoneOffset offsetNow = now.getOffset();
OffsetDateTime fixedDatetime = offsetDateTime.withOffsetSameInstant(offsetNow);
String newMatchTime = fixedDatetime.toString();
tlwMatch.setMatchDateTime(newMatchTime.replace("T", " ").substring(0, 16) + ":00");
}
}