From 126b9778c081bf003e866315b68470f1b56567e9 Mon Sep 17 00:00:00 2001 From: Julian Arndt Date: Sat, 17 Oct 2020 09:55:04 +0200 Subject: [PATCH] Remove Timezone bullshit --- .../java/de/jeyp91/apifootball/APIFootballMatch.java | 10 +++++----- .../de/jeyp91/tippliga/TLWMatchesUpdaterFootball.java | 8 +------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/main/java/de/jeyp91/apifootball/APIFootballMatch.java b/src/main/java/de/jeyp91/apifootball/APIFootballMatch.java index 325072c..0e4603d 100644 --- a/src/main/java/de/jeyp91/apifootball/APIFootballMatch.java +++ b/src/main/java/de/jeyp91/apifootball/APIFootballMatch.java @@ -14,12 +14,12 @@ import java.nio.charset.StandardCharsets; public class APIFootballMatch extends BaseMatch { - private int season; - private int matchId; - private int leagueId; + private final int season; + private final int matchId; + private final int leagueId; private String matchStatus; - private String teamNameHome; - private String teamNameGuest; + private final String teamNameHome; + private final String teamNameGuest; public APIFootballMatch(JSONObject json, int season) { this.season = season; diff --git a/src/main/java/de/jeyp91/tippliga/TLWMatchesUpdaterFootball.java b/src/main/java/de/jeyp91/tippliga/TLWMatchesUpdaterFootball.java index b73a3f4..285b081 100644 --- a/src/main/java/de/jeyp91/tippliga/TLWMatchesUpdaterFootball.java +++ b/src/main/java/de/jeyp91/tippliga/TLWMatchesUpdaterFootball.java @@ -136,13 +136,7 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase { { for(APIFootballMatch apiFootballMatch : apiFootballMatches) { TLWMatch tlwMatch = getMatchingMatch(apiFootballMatch, tlwMatches); - 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"); + tlwMatch.setMatchDateTime(apiFootballMatch.getMatchDateTime().replace("T", " ").substring(0, 19)); } }