Added missing documentation
[fiscal-year.java.git] / src / main / java / com / github / sebhoss / time / EarlyFiscalYearCalculator.java
blobf0362373cc425b53f9e17b66958adf49f7b1e5cf
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 final class EarlyFiscalYearCalculator implements FiscalYearCalculator {
14 private final int fiscalYearStartMonth;
16 EarlyFiscalYearCalculator(final int fiscalYearStartMonth) {
17 this.fiscalYearStartMonth = fiscalYearStartMonth;
20 @Override
21 public int calculateFiscalYear(final LocalDate calendarDate) {
22 if (fiscalYearStartMonth <= calendarDate.getMonthOfYear()) {
23 return calendarDate.getYear() + 1;
26 return calendarDate.getYear();