2 * This program is free software. It comes without any warranty, to
3 * the extent permitted by applicable law. You can redistribute it
4 * and/or modify it under the terms of the Do What The Fuck You Want
5 * To Public License, Version 2, as published by Sam Hocevar. See
6 * http://www.wtfpl.net/ for more details.
8 package com
.github
.sebhoss
.time
;
10 import org
.joda
.time
.LocalDate
;
12 final class EarlyFiscalDateCalculator
extends AbstractFiscalDateCalculator
{
14 EarlyFiscalDateCalculator(final int fiscalStartMonth
) {
15 super(fiscalStartMonth
);
19 public int calculateFiscalYear(final LocalDate calendarDate
) {
20 if (fiscalYearStartMonth
<= calendarDate
.getMonthOfYear()) {
21 return calendarDate
.getYear() + 1;
24 return calendarDate
.getYear();
28 protected int calculateCalendarYear(final int fiscalYear
, final int fiscalMonth
) {
29 if (fiscalMonth
<= 12 - fiscalYearStartMonth
+ 1) {
30 return fiscalYear
- 1;