Finish gist
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user