The constructor for a Week in Week.java has a bug. Should it not have the additional line to set the Calendar time using time?
public Week(Date time) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(time); //!! MOD
this.week = calendar.get(Calendar.WEEK_OF_YEAR);
this.year = new Year(calendar.get(Calendar.YEAR));
}
Otherwise getWeek() returns current week & year always.
Week constructor bug!
Re: Week constructor bug!
Thanks for reporting this. I've added the fix to my source, so it will be included in the next release.
Regards,
DG.
Regards,
DG.
Re: Week constructor bug!
Actually, this seems to be wrong in Minute as well. And in Month. And in Hour. And in Second.
It works in Day.
While I'm at it, is there a special reason why all these are in com.jrefinery.data and not in jrefinery.date?
GreGie
It works in Day.
While I'm at it, is there a special reason why all these are in com.jrefinery.data and not in jrefinery.date?
GreGie
Re: Week constructor bug!
The joys of cut and paste...I fixed all these this morning and hopefully I'll get an update out in the next day or so.
>While I'm at it, is there a special reason why all these are in com.jrefinery.data and not in jrefinery.date?
There is a reason, but it is not special. These are all support classes for the TimeSeriesCollection class, which definitely fits into the data package, and so they ended up in the same package because...well, because.
I'll look at it again and see if I think it is worth moving them...
DG.
>While I'm at it, is there a special reason why all these are in com.jrefinery.data and not in jrefinery.date?
There is a reason, but it is not special. These are all support classes for the TimeSeriesCollection class, which definitely fits into the data package, and so they ended up in the same package because...well, because.
I'll look at it again and see if I think it is worth moving them...
DG.