Provide predefined intervals: Year, Month, Day
Project moved to GitHub
Brought to you by:
broneill,
scolebourne
It would be very useful if one could write code like the one below:
Days days = new Year(2011).days();
for (Day day: days) {
if(isFriday13(day)) {
println("I shall stay at home at " + day);
}
}
Year should have method:
public List<Month> months();
Year and Month should have method:
public List<Day> days();
Similarily there should be support for Partials as well, let say: CalendarYear, CalendarMonth and CalendarDay.
The trouble with dates and times is that there are many possible features. The idea of looping around dates is not necessarily a bad idea, but it would involve expanding the API further. For now, I'll see if this fits into ThreeTen/JSR-310.