Refactored FiscalYear/-Month/-Week/-Day-Calculators into single
[fiscal-year.java.git] / src / main / java / com / github / sebhoss / time / LateFiscalDateCalculator.java
blobff189dfc46804cf1c34ba32ab5a2ec98965d6980
1 /*
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.
7 */
8 package com.github.sebhoss.time;
10 import org.joda.time.LocalDate;
12 /**
13 * TODO: Write documentation
15 final class LateFiscalDateCalculator extends AbstractFiscalDateCalculator {
17 LateFiscalDateCalculator(final int fiscalStartMonth) {
18 super(fiscalStartMonth);
21 @Override
22 public int calculateFiscalYear(final LocalDate calendarDate) {
23 if (fiscalYearStartMonth <= calendarDate.getMonthOfYear()) {
24 return calendarDate.getYear();
27 return calendarDate.getYear() - 1;