Skip to content

Commit

Permalink
prettier printouts
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasore committed Oct 16, 2015
1 parent 659f7e3 commit 94e396a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions src/main/java/org/oreland/entity/Activity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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();
}
}
6 changes: 3 additions & 3 deletions src/main/java/org/oreland/sync/MyClub.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 94e396a

Please sign in to comment.