package org.hedgecode.snooker;
+import java.text.DateFormat;
import java.text.SimpleDateFormat;
import org.hedgecode.snooker.api.APIException;
private static final String UPCOMING_EVENTS = " Upcoming Snooker Events: ";
private static final String INDENT = " ";
- private static SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd.MM.yyyy");
+ private static final String DATE_FORMAT = "dd.MM.yyyy";
private static final int UPCOMING_COUNT = 5;
}
private static void printEvent(Event event) {
+ final DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
System.out.println(
INDENT + event.name()
- + " [" + DATE_FORMAT.format(event.startDate())
- + " - " + DATE_FORMAT.format(event.endDate()) + "]"
+ + " [" + dateFormat.format(event.startDate())
+ + " - " + dateFormat.format(event.endDate()) + "]"
+ " (" + event.country() + ", " + event.city() + ")"
);
}