diff --git a/src/main/java/org/oreland/entity/Activity.java b/src/main/java/org/oreland/entity/Activity.java index 90bf63d..c1446fe 100644 --- a/src/main/java/org/oreland/entity/Activity.java +++ b/src/main/java/org/oreland/entity/Activity.java @@ -3,6 +3,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.text.SimpleDateFormat; /** * Created by jonas on 10/4/15. @@ -85,4 +86,13 @@ public Activity(String id, Date date, String desc, Type type) { this.synced = false; this.type = type; } + + public String toString() { + StringBuilder sb = new StringBuilder(); + + sb.append(type); + sb.append(" "); + sb.append(new SimpleDateFormat("yyyy-MM-dd").format(date)); + return sb.toString(); + } } diff --git a/src/main/java/org/oreland/sync/MyClub.java b/src/main/java/org/oreland/sync/MyClub.java index fc2b70b..7646b5a 100644 --- a/src/main/java/org/oreland/sync/MyClub.java +++ b/src/main/java/org/oreland/sync/MyClub.java @@ -378,16 +378,16 @@ public void loadActivities(Repository repo) throws IOException, ParseException { activity = repo.add(new Activity(id, formatter.parse(date), desc, Activity.Type.TRAINING)); } if (activity != null && activity.type == Activity.Type.GAME && activity.level == null) { - System.err.println("Loading level for game " + activity.date); + System.err.println("Loading level for " + activity.toString()); loadActivityLevel(repo, activity); } if (activity != null && activity.synced == false && activity.date.before(limit)) { - System.err.println("Loading invitations/participants for game " + activity.date); + System.err.println("Loading invitations/participants for " + activity.toString()); loadInvitations(repo, activity); loadParticipants(repo, activity); if (activity.date.before(today)) { if (columns.get(9).text().matches(".*[Gg]odk.*nd")) { - System.out.println("" + activity.date + " is after " + today + " => synced"); + System.out.println(activity + " is complete."); activity.synced = true; } }