I have the following problem: I need to get the week year of a fiscal year, but the thing is that I can have a dynamic fiscal year. For instance, instead of considering the end of my fiscal year December, 31, the end of my fiscal year will be August, 15.
So I should consider my year being from: August 16, (CurrentYear -1) until August 15, CurrentYear.
This way, I need to create a method passing some date, let say August 18, (CurrentYear-1) and this method should return the week of the year. In this case, it would be 1.
I know that with Java I can get the week year with something like:
Calendar cal = Calendar.getInstance();
cal.setTime(selectedDate.toDate());
int weekNumber = cal.get(Calendar.WEEK_OF_YEAR);
I'd like to know if there is some API that does this same math based in a dynamic "End of the year", or maybe some idea about how to do that.