Class OceanusDateUtils
java.lang.Object
io.github.tonywasher.joceanus.oceanus.date.OceanusDateUtils
Date utilities.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intageOn(OceanusDate pBirthDate, OceanusDate pDate) Calculate the age that someone born on a particular date will be on a given date.static OceanusDateendCalendarMonth(OceanusDate pDate) Obtain the date of the end of the month.static OceanusDateendCalendarYear(OceanusDate pDate) Obtain the date of the end of the year.static OceanusDateendNextMonth(OceanusDate pDate) Obtain the date of the end of the following month.static OceanusDatestartCalendarMonth(OceanusDate pDate) Obtain the date of the start of the month.static OceanusDatestartCalendarQuarter(OceanusDate pDate) Obtain the date of the start of the quarter.static OceanusDatestartCalendarYear(OceanusDate pDate) Obtain the date of the start of the year.static OceanusDatestartFiscalYear(OceanusDate pDate) Adjust the date to the start of the fiscal year.static OceanusDatestartPeriod(OceanusDate pDate, OceanusDatePeriod pPeriod) Obtain the date of the start of the period.
-
Method Details
-
startPeriod
Obtain the date of the start of the period.- Parameters:
pDate- the date to adjustpPeriod- the period to adjust by- Returns:
- the adjusted date
-
endNextMonth
Obtain the date of the end of the following month.- Parameters:
pDate- the date to adjust- Returns:
- the date
-
startCalendarMonth
Obtain the date of the start of the month.- Parameters:
pDate- the date to adjust- Returns:
- the date
-
endCalendarMonth
Obtain the date of the end of the month.- Parameters:
pDate- the date to adjust- Returns:
- the date
-
startCalendarQuarter
Obtain the date of the start of the quarter.- Parameters:
pDate- the date to adjust- Returns:
- the date
-
startCalendarYear
Obtain the date of the start of the year.- Parameters:
pDate- the date to adjust- Returns:
- the date
-
endCalendarYear
Obtain the date of the end of the year.- Parameters:
pDate- the date to adjust- Returns:
- the date
-
startFiscalYear
Adjust the date to the start of the fiscal year.- Parameters:
pDate- the date to adjust- Returns:
- the date
-
ageOn
Calculate the age that someone born on a particular date will be on a given date.- Parameters:
pBirthDate- the birthDatepDate- the date for which to calculate the age- Returns:
- the age on that date
-