Fix small bugs in google calendar event generator

This commit is contained in:
2024-06-20 19:03:44 +02:00
parent 237d71c03d
commit db6f20c339
2 changed files with 7 additions and 2 deletions

View File

@@ -61,6 +61,9 @@ public class TippligaGoogleEventManager {
public static Event findEvent(List<Event> allEvents, Integer season, Integer league, Integer matchday, Integer deliveryDateNumber) { public static Event findEvent(List<Event> allEvents, Integer season, Integer league, Integer matchday, Integer deliveryDateNumber) {
String description = getDescription(season, league, matchday, deliveryDateNumber); String description = getDescription(season, league, matchday, deliveryDateNumber);
String descriptionHtml = getDescriptionHTML(season, league, matchday, deliveryDateNumber); String descriptionHtml = getDescriptionHTML(season, league, matchday, deliveryDateNumber);
if(matchday == 34) {
String debug = "";
}
for (Event event : allEvents) { for (Event event : allEvents) {
String eventDescription = event.getDescription(); String eventDescription = event.getDescription();
if ( if (
@@ -87,8 +90,10 @@ public class TippligaGoogleEventManager {
} }
else { else {
String googleEventStart = event.getStart().getDateTime().toString(); String googleEventStart = event.getStart().getDateTime().toString();
String googleEventEnd = event.getEnd().getDateTime().toString();
String googleEventStartBeautified = googleEventStart.substring(0, 19).replace("T", " "); String googleEventStartBeautified = googleEventStart.substring(0, 19).replace("T", " ");
if(!googleEventStartBeautified.equals(deliveryDateString)) { if(!googleEventStartBeautified.equals(deliveryDateString)
|| !googleEventEnd.equals(googleEventStart)) {
updateEvent(event, matchday, deliveryDateString, deliverDateNumber); updateEvent(event, matchday, deliveryDateString, deliverDateNumber);
} }
} }

View File

@@ -43,7 +43,7 @@ public class TLWLeague {
public String getLeagueNameCalendar() { public String getLeagueNameCalendar() {
String leagueName = this.leagueName; String leagueName = this.leagueName;
if (leagueName.equals("1. Tippliga") || leagueName.equals("2. Tippliga")) { if (leagueName.equals("1. Tippliga Würzburg") || leagueName.equals("2. Tippliga Würzburg")) {
leagueName = "Tippliga"; leagueName = "Tippliga";
} }
return leagueName; return leagueName;