Closed GoogleCodeExporter closed 8 years ago
Related to issue 107
Original comment by dirkvran...@gmail.com
on 8 Dec 2010 at 8:12
I wrote some additional notes to issue 111 that somewhat related to these issues
Original comment by tnm.cont...@gmail.com
on 8 Dec 2010 at 8:22
I added the day in the list. Better?
Dirk, any ideas how to add number of episodes with the date listing?
Original comment by ivoniftrik
on 12 Dec 2010 at 12:20
Attachments:
Ok that's fine for me with the day of the week.
How did you implement it? If you have a look at the DateUtil class you'll see
there are different methods available for formatting dates. Did you create an
extra method "formatDateFull"?
Yeah I have some ideas for the number of episodes.
Currently to calculate which different dates to add to the list we have a
List<Date> workinglist variable. The code would have to change to something
like this (there can be errors in it, don't have a compiler here :p):
//Get all the airdates and the episode count
Map<Date, int> workingMap = new TreeMap<Date, int>();
for (Show show : shows) {
for(Episode episode : show.getEpisodes()) {
Date airDate = episode.getAirDate();
if(!workingMap .containsKey(airDate)) {
workingMap.put(airDate, 1);
} else {
int count = workingMap.get(airDate);
workingMap.put(airDate, ++count);
}
}
}
//The map is a TreeMap (SortedMap) so sorting should not be done manually
anymore unless we want the user to configure sorting order in the preferences
//iterate over map instead of the list
Set dateKeySet = workingMap.keySet();
for(Date date: dateKeySet) {
//Rest of the adding code
}
Original comment by dirkvran...@gmail.com
on 16 Dec 2010 at 11:11
Yes I added a 'formatDateFull' method ;)
Thanks for the code, gonna try it.
Original comment by ivoniftrik
on 16 Dec 2010 at 11:22
Fixed, thnx for your code ;)
Original comment by ivoniftrik
on 16 Dec 2010 at 6:35
Attachments:
Ivo,
can you have a look at this again? When I was testing it didn't work for both
the day of the week and the number of episodes... :s
Oh btw: Some of the names of the activities have changed so update fist... just
so you know ;)
Original comment by dirkvran...@gmail.com
on 22 Jan 2011 at 12:49
added code from revision 401.
Original comment by ivoniftrik
on 22 Jan 2011 at 2:31
Original issue reported on code.google.com by
scolapa...@gmail.com
on 7 Dec 2010 at 10:48