Skip to content
This repository has been archived by the owner on Mar 20, 2018. It is now read-only.

Commit

Permalink
Rename ZeroEpochMonth; Explore packed-date-time
Browse files Browse the repository at this point in the history
  • Loading branch information
jodastephen committed Nov 9, 2011
1 parent a3c39e5 commit a12eaef
Show file tree
Hide file tree
Showing 16 changed files with 129 additions and 87 deletions.
49 changes: 44 additions & 5 deletions src/main/java/javax/time/calendar/DateTimeRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,16 @@ protected DateTimeRuleRange doValueRangeFromOther(DateTimeRule valueRule, long v
}

//-----------------------------------------------------------------------
public final long extractFrom(DateTimeRule valueRule, long epSecs) {
/**
* Extracts the value of this rule from the specified rule.
*
* @param valueRule the rule to extract from
* @param pdt the packed date-time value
* @return the value in terms of this rule, MIN_VALUE if unable to convert
*/
public final long extractFrom(DateTimeRule valueRule, long pdt) {
if (isExtractableFrom(valueRule)) {
return doExtractFrom(valueRule, epSecs);
return doExtractFrom(valueRule, pdt);
}
return Long.MIN_VALUE;
}
Expand All @@ -323,12 +330,44 @@ protected boolean doIsExtractableTo(DateTimeRule childRule) {
return false;
}

protected long doExtractFrom(DateTimeRule valueRule, long epSecs) {
protected long doExtractFrom(DateTimeRule valueRule, long pdt) {
return Long.MIN_VALUE;
}

protected static final long epochDaysFromEpochSecs(long epSecs) {
return epSecs / ISOChronology.SECONDS_PER_DAY;
//-----------------------------------------------------------------------
protected static final long packedDateFromPackedDateTime(long pdt) {
return pdt / ISOChronology.SECONDS_PER_DAY;
}

protected static final long epochMonthFromPackedDateTime(long pdt) {
return pdt / (ISOChronology.SECONDS_PER_DAY * 32);
}

protected static final long epochDaysFromPackedDateTime(long pdt) {
return edFromPemd(packedDateFromPackedDateTime(pdt));
}

private static long edFromPemd(long pd) {
long em = epochMonthFromPackedDateTime(pd);
long year = (em / 12) + 1970;
long y = year;
long m = (em % 12) + 1;
long total = 0;
total += 365 * y;
if (y >= 0) {
total += (y + 3) / 4 - (y + 99) / 100 + (y + 399) / 400;
} else {
total -= y / -4 - y / -100 + y / -400;
}
total += ((367 * m - 362) / 12);
total += (pd & 31);
if (m > 2) {
total--;
if (ISOChronology.isLeapYear(year) == false) {
total--;
}
}
return total - ISOChronology.DAYS_0000_TO_1970;
}

//-----------------------------------------------------------------------
Expand Down
59 changes: 30 additions & 29 deletions src/main/java/javax/time/calendar/ISODateTimeRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ protected DateTimeRuleRange doValueRangeFromOther(DateTimeRule valueRule, long v

//-----------------------------------------------------------------------
@Override
protected long doExtractFrom(DateTimeRule valueRule, long epSecs) {
protected long doExtractFrom(DateTimeRule valueRule, long pdt) {
switch (ordinal) {
case SECOND_OF_MINUTE_ORDINAL:
case SECOND_OF_HOUR_ORDINAL:
Expand All @@ -261,21 +261,22 @@ protected long doExtractFrom(DateTimeRule valueRule, long epSecs) {
case CLOCK_HOUR_OF_DAY_ORDINAL:
case HOUR_OF_DAY_ORDINAL:
case AMPM_OF_DAY_ORDINAL:
return extractFromSod(epSecs, this);
return extractFromSod(pdt, this);
case DAY_OF_WEEK_ORDINAL:
case EPOCH_DAY_ORDINAL:
return extractFromEd(epochDaysFromPackedDateTime(pdt), this);
case DAY_OF_MONTH_ORDINAL:
case DAY_OF_YEAR_ORDINAL:
case EPOCH_DAY_ORDINAL:
case ALIGNED_WEEK_OF_MONTH_ORDINAL:
case ALIGNED_WEEK_OF_YEAR_ORDINAL:
case MONTH_OF_QUARTER_ORDINAL:
case MONTH_OF_YEAR_ORDINAL:
case QUARTER_OF_YEAR_ORDINAL:
case ZERO_EPOCH_MONTH_ORDINAL:
case EPOCH_MONTH_ORDINAL:
case YEAR_ORDINAL:
case PACKED_EPOCH_MONTH_DAY_ORDINAL:
case PACKED_YEAR_DAY_ORDINAL:
return extractFromEd(epochDaysFromEpochSecs(epSecs), this);
return extractFromPemd(packedDateFromPackedDateTime(pdt), this);
}
return Long.MIN_VALUE;
}
Expand All @@ -299,7 +300,7 @@ protected boolean doIsExtractableFrom(DateTimeRule parentRule) {
case (EPOCH_DAY_ORDINAL << 16) + ALIGNED_WEEK_OF_YEAR_ORDINAL:
case (EPOCH_DAY_ORDINAL << 16) + MONTH_OF_QUARTER_ORDINAL:
case (EPOCH_DAY_ORDINAL << 16) + MONTH_OF_YEAR_ORDINAL:
case (EPOCH_DAY_ORDINAL << 16) + ZERO_EPOCH_MONTH_ORDINAL:
case (EPOCH_DAY_ORDINAL << 16) + EPOCH_MONTH_ORDINAL:
case (EPOCH_DAY_ORDINAL << 16) + QUARTER_OF_YEAR_ORDINAL:
case (EPOCH_DAY_ORDINAL << 16) + YEAR_ORDINAL:
case (EPOCH_DAY_ORDINAL << 16) + PACKED_EPOCH_MONTH_DAY_ORDINAL:
Expand All @@ -310,11 +311,11 @@ protected boolean doIsExtractableFrom(DateTimeRule parentRule) {
case (MONTH_OF_YEAR_ORDINAL << 16) + MONTH_OF_QUARTER_ORDINAL:
case (MONTH_OF_YEAR_ORDINAL << 16) + MONTH_OF_YEAR_ORDINAL:
case (MONTH_OF_YEAR_ORDINAL << 16) + QUARTER_OF_YEAR_ORDINAL:
case (ZERO_EPOCH_MONTH_ORDINAL << 16) + MONTH_OF_QUARTER_ORDINAL:
case (ZERO_EPOCH_MONTH_ORDINAL << 16) + MONTH_OF_YEAR_ORDINAL:
case (ZERO_EPOCH_MONTH_ORDINAL << 16) + ZERO_EPOCH_MONTH_ORDINAL:
case (ZERO_EPOCH_MONTH_ORDINAL << 16) + QUARTER_OF_YEAR_ORDINAL:
case (ZERO_EPOCH_MONTH_ORDINAL << 16) + YEAR_ORDINAL:
case (EPOCH_MONTH_ORDINAL << 16) + MONTH_OF_QUARTER_ORDINAL:
case (EPOCH_MONTH_ORDINAL << 16) + MONTH_OF_YEAR_ORDINAL:
case (EPOCH_MONTH_ORDINAL << 16) + EPOCH_MONTH_ORDINAL:
case (EPOCH_MONTH_ORDINAL << 16) + QUARTER_OF_YEAR_ORDINAL:
case (EPOCH_MONTH_ORDINAL << 16) + YEAR_ORDINAL:
case (QUARTER_OF_YEAR_ORDINAL << 16) + QUARTER_OF_YEAR_ORDINAL:
case (YEAR_ORDINAL << 16) + YEAR_ORDINAL:
case (PACKED_EPOCH_MONTH_DAY_ORDINAL << 16) + DAY_OF_WEEK_ORDINAL:
Expand All @@ -325,7 +326,7 @@ protected boolean doIsExtractableFrom(DateTimeRule parentRule) {
case (PACKED_EPOCH_MONTH_DAY_ORDINAL << 16) + ALIGNED_WEEK_OF_YEAR_ORDINAL:
case (PACKED_EPOCH_MONTH_DAY_ORDINAL << 16) + MONTH_OF_QUARTER_ORDINAL:
case (PACKED_EPOCH_MONTH_DAY_ORDINAL << 16) + MONTH_OF_YEAR_ORDINAL:
case (PACKED_EPOCH_MONTH_DAY_ORDINAL << 16) + ZERO_EPOCH_MONTH_ORDINAL:
case (PACKED_EPOCH_MONTH_DAY_ORDINAL << 16) + EPOCH_MONTH_ORDINAL:
case (PACKED_EPOCH_MONTH_DAY_ORDINAL << 16) + QUARTER_OF_YEAR_ORDINAL:
case (PACKED_EPOCH_MONTH_DAY_ORDINAL << 16) + YEAR_ORDINAL:
case (PACKED_EPOCH_MONTH_DAY_ORDINAL << 16) + PACKED_EPOCH_MONTH_DAY_ORDINAL:
Expand All @@ -338,7 +339,7 @@ protected boolean doIsExtractableFrom(DateTimeRule parentRule) {
case (PACKED_YEAR_DAY_ORDINAL << 16) + ALIGNED_WEEK_OF_YEAR_ORDINAL:
case (PACKED_YEAR_DAY_ORDINAL << 16) + MONTH_OF_QUARTER_ORDINAL:
case (PACKED_YEAR_DAY_ORDINAL << 16) + MONTH_OF_YEAR_ORDINAL:
case (PACKED_YEAR_DAY_ORDINAL << 16) + ZERO_EPOCH_MONTH_ORDINAL:
case (PACKED_YEAR_DAY_ORDINAL << 16) + EPOCH_MONTH_ORDINAL:
case (PACKED_YEAR_DAY_ORDINAL << 16) + QUARTER_OF_YEAR_ORDINAL:
case (PACKED_YEAR_DAY_ORDINAL << 16) + YEAR_ORDINAL:
case (PACKED_YEAR_DAY_ORDINAL << 16) + PACKED_EPOCH_MONTH_DAY_ORDINAL:
Expand Down Expand Up @@ -396,7 +397,7 @@ long extractISO(long value, ISODateTimeRule requiredRule) {
case DAY_OF_YEAR_ORDINAL: return extractFromDoy(value, requiredRule);
case EPOCH_DAY_ORDINAL: return extractFromEd(value, requiredRule);
case MONTH_OF_YEAR_ORDINAL: return extractFromMoy(value, requiredRule);
case ZERO_EPOCH_MONTH_ORDINAL: return extractFromEm(value, requiredRule);
case EPOCH_MONTH_ORDINAL: return extractFromEm(value, requiredRule);
case PACKED_EPOCH_MONTH_DAY_ORDINAL: return extractFromPemd(value, requiredRule);
case PACKED_YEAR_DAY_ORDINAL: return extractFromPyd(value, requiredRule);
}
Expand Down Expand Up @@ -506,7 +507,7 @@ private static long extractFromEd(long ed, ISODateTimeRule requiredRule) {
case MONTH_OF_QUARTER_ORDINAL: return moqFromMoy(moyFromEm(emFromPemd(pemdFromEd(ed))));
case MONTH_OF_YEAR_ORDINAL: return moyFromEm(emFromPemd(pemdFromEd(ed)));
case QUARTER_OF_YEAR_ORDINAL: return qoyFromMoy(moyFromEm(emFromPemd(pemdFromEd(ed))));
case ZERO_EPOCH_MONTH_ORDINAL: return emFromPemd(pemdFromEd(ed));
case EPOCH_MONTH_ORDINAL: return emFromPemd(pemdFromEd(ed));
case YEAR_ORDINAL: return yFromEm(emFromPemd(pemdFromEd(ed)));
case PACKED_EPOCH_MONTH_DAY_ORDINAL: return pemdFromEd(ed);
case PACKED_YEAR_DAY_ORDINAL: return pydFromEd(ed);
Expand Down Expand Up @@ -564,7 +565,7 @@ private static long extractFromPemd(long pemd, ISODateTimeRule requiredRule) {
case MONTH_OF_QUARTER_ORDINAL: return moqFromMoy(moyFromEm(emFromPemd(pemd)));
case MONTH_OF_YEAR_ORDINAL: return moyFromEm(emFromPemd(pemd));
case QUARTER_OF_YEAR_ORDINAL: return qoyFromMoy(moyFromEm(emFromPemd(pemd)));
case ZERO_EPOCH_MONTH_ORDINAL: return emFromPemd(pemd);
case EPOCH_MONTH_ORDINAL: return emFromPemd(pemd);
case YEAR_ORDINAL: return yFromEm(emFromPemd(pemd));
case PACKED_YEAR_DAY_ORDINAL: return pyFromPemd(pemd);
}
Expand Down Expand Up @@ -634,7 +635,7 @@ private static long extractFromPyd(long pyd, ISODateTimeRule requiredRule) {
case MONTH_OF_QUARTER_ORDINAL: return moqFromMoy(moyFromEm(emFromPemd(pemdFromPyd(pyd))));
case MONTH_OF_YEAR_ORDINAL: return moyFromEm(emFromPemd(pemdFromPyd(pyd)));
case QUARTER_OF_YEAR_ORDINAL: return qoyFromMoy(moyFromEm(emFromPemd(pemdFromPyd(pyd))));
case ZERO_EPOCH_MONTH_ORDINAL: return emFromPemd(pyd);
case EPOCH_MONTH_ORDINAL: return emFromPemd(pyd);
case YEAR_ORDINAL: return yFromPyd(pyd);
case PACKED_EPOCH_MONTH_DAY_ORDINAL: return pemdFromPyd(pyd);
}
Expand Down Expand Up @@ -728,7 +729,7 @@ protected void normalize(CalendricalEngine engine) {
case DAY_OF_MONTH_ORDINAL: {
// year-month-day
DateTimeField dom = engine.getField(DAY_OF_MONTH, false);
DateTimeField epm = engine.getField(ZERO_EPOCH_MONTH, false);
DateTimeField epm = engine.getField(EPOCH_MONTH, false);
if (dom != null && epm != null) {
int year = MathUtils.safeToInt(MathUtils.floorDiv(epm.getValue(), 12));
int moy = MathUtils.floorMod(epm.getValue(), 12) + 1;
Expand All @@ -752,7 +753,7 @@ protected void normalize(CalendricalEngine engine) {
// year-month-alignedWeek-day
DateTimeField dow = engine.getField(DAY_OF_WEEK, false);
DateTimeField wom = engine.getField(ALIGNED_WEEK_OF_MONTH, false);
DateTimeField epm = engine.getField(ZERO_EPOCH_MONTH, false);
DateTimeField epm = engine.getField(EPOCH_MONTH, false);
if (dow != null && wom != null && epm != null) {
int year = MathUtils.safeToInt(MathUtils.floorDiv(epm.getValue(), 12));
int moy = MathUtils.floorMod(epm.getValue(), 12) + 1;
Expand Down Expand Up @@ -826,7 +827,7 @@ DateTimeField deriveFrom(LocalDate date, LocalTime time, ZoneOffset offset) {
case ALIGNED_WEEK_OF_YEAR_ORDINAL: return field((date.getDayOfYear() - 1) / 7 + 1);
case MONTH_OF_QUARTER_ORDINAL: return field(date.getMonthOfYear().getMonthOfQuarter());
case MONTH_OF_YEAR_ORDINAL: return field(date.getMonthOfYear().getValue());
case ZERO_EPOCH_MONTH_ORDINAL: return field(MathUtils.safeAdd(MathUtils.safeMultiply(date.getYear(), 12L), date.getMonthOfYear().ordinal()));
case EPOCH_MONTH_ORDINAL: return field(MathUtils.safeAdd(MathUtils.safeMultiply(date.getYear(), 12L), date.getMonthOfYear().ordinal()));
case QUARTER_OF_YEAR_ORDINAL: return field(date.getMonthOfYear().getQuarterOfYear().getValue());
case WEEK_BASED_YEAR_ORDINAL: return field(ISOChronology.getWeekBasedYearFromDate(date));
case YEAR_ORDINAL: return field(date.getYear());
Expand Down Expand Up @@ -963,7 +964,7 @@ public int hashCode() {
private static final int ALIGNED_WEEK_OF_YEAR_ORDINAL = 26 * 16;
private static final int MONTH_OF_QUARTER_ORDINAL = 27 * 16;
private static final int MONTH_OF_YEAR_ORDINAL = 28 * 16;
private static final int ZERO_EPOCH_MONTH_ORDINAL = 29 * 16;
private static final int EPOCH_MONTH_ORDINAL = 29 * 16;
private static final int QUARTER_OF_YEAR_ORDINAL = 30 * 16;
private static final int WEEK_BASED_YEAR_ORDINAL = 31 * 16;
private static final int YEAR_ORDINAL = 32 * 16;
Expand Down Expand Up @@ -1197,21 +1198,21 @@ public int hashCode() {
public static final ISODateTimeRule ALIGNED_WEEK_OF_YEAR = new ISODateTimeRule(ALIGNED_WEEK_OF_YEAR_ORDINAL, "AlignedWeekOfYear", WEEKS, YEARS, 1, 53, 53, DAY_OF_YEAR);

/**
* The rule for the zero-epoch-month field.
* The rule for the epoch-month field.
* <p>
* This field counts months sequentially from 0000-01-01 in the ISO year
* This field counts months sequentially from 1970-01-01 in the ISO year
* numbering scheme, see {@link #YEAR}.
* The values run from Long.MIN_VALUE to Long.MAX_VALUE.
*/
public static final ISODateTimeRule ZERO_EPOCH_MONTH = new ISODateTimeRule(ZERO_EPOCH_MONTH_ORDINAL, "ZeroEpochMonth", MONTHS, null, Long.MIN_VALUE, Long.MAX_VALUE, Long.MAX_VALUE, null);
public static final ISODateTimeRule EPOCH_MONTH = new ISODateTimeRule(EPOCH_MONTH_ORDINAL, "EpochMonth", MONTHS, null, Long.MIN_VALUE, Long.MAX_VALUE, Long.MAX_VALUE, null);
/**
* The rule for the month-of-quarter field in the ISO chronology.
* <p>
* This field counts months sequentially from the start of the quarter.
* The first month of the quarter is 1 and the last is 3.
* Each quarter lasts exactly three months.
*/
public static final ISODateTimeRule MONTH_OF_QUARTER = new ISODateTimeRule(MONTH_OF_QUARTER_ORDINAL, "MonthOfQuarter", MONTHS, QUARTERS, 1, 3, 3, ZERO_EPOCH_MONTH);
public static final ISODateTimeRule MONTH_OF_QUARTER = new ISODateTimeRule(MONTH_OF_QUARTER_ORDINAL, "MonthOfQuarter", MONTHS, QUARTERS, 1, 3, 3, EPOCH_MONTH);
/**
* The rule for the month-of-year field in the ISO chronology.
* <p>
Expand All @@ -1222,15 +1223,15 @@ public int hashCode() {
* The enum {@link MonthOfYear} should be used wherever possible in applications
* when referring to the day of the week to avoid hard-coding the values.
*/
public static final ISODateTimeRule MONTH_OF_YEAR = new ISODateTimeRule(MONTH_OF_YEAR_ORDINAL, "MonthOfYear", MONTHS, YEARS, 1, 12, 12, ZERO_EPOCH_MONTH);
public static final ISODateTimeRule MONTH_OF_YEAR = new ISODateTimeRule(MONTH_OF_YEAR_ORDINAL, "MonthOfYear", MONTHS, YEARS, 1, 12, 12, EPOCH_MONTH);
/**
* The rule for the quarter-of-year field in the ISO chronology.
* <p>
* This field counts quarters sequentially from the start of the year.
* The first quarter of the year is 1 and the last is 4.
* Each quarter lasts exactly three months.
*/
public static final ISODateTimeRule QUARTER_OF_YEAR = new ISODateTimeRule(QUARTER_OF_YEAR_ORDINAL, "QuarterOfYear", QUARTERS, YEARS, 1, 4, 4, ZERO_EPOCH_MONTH);
public static final ISODateTimeRule QUARTER_OF_YEAR = new ISODateTimeRule(QUARTER_OF_YEAR_ORDINAL, "QuarterOfYear", QUARTERS, YEARS, 1, 4, 4, EPOCH_MONTH);
/**
* The rule for the year field in the ISO chronology.
* <p>
Expand All @@ -1246,7 +1247,7 @@ public int hashCode() {
* exists. This roughly equates to 1 BC/BCE, however the alignment is
* not exact as explained above.
*/
public static final ISODateTimeRule YEAR = new ISODateTimeRule(YEAR_ORDINAL, "Year", YEARS, null, Year.MIN_YEAR, Year.MAX_YEAR, Year.MAX_YEAR, ZERO_EPOCH_MONTH);
public static final ISODateTimeRule YEAR = new ISODateTimeRule(YEAR_ORDINAL, "Year", YEARS, null, Year.MIN_YEAR, Year.MAX_YEAR, Year.MAX_YEAR, EPOCH_MONTH);

/**
* The rule for the week-based-year field in the ISO chronology.
Expand Down Expand Up @@ -1308,7 +1309,7 @@ public int hashCode() {
CLOCK_HOUR_OF_AMPM, HOUR_OF_AMPM, CLOCK_HOUR_OF_DAY, HOUR_OF_DAY, AMPM_OF_DAY,
DAY_OF_WEEK, DAY_OF_MONTH, DAY_OF_YEAR, EPOCH_DAY,
ALIGNED_WEEK_OF_MONTH, WEEK_OF_WEEK_BASED_YEAR, ALIGNED_WEEK_OF_YEAR,
MONTH_OF_QUARTER, MONTH_OF_YEAR, ZERO_EPOCH_MONTH,
MONTH_OF_QUARTER, MONTH_OF_YEAR, EPOCH_MONTH,
QUARTER_OF_YEAR,
WEEK_BASED_YEAR,
YEAR,
Expand Down
14 changes: 9 additions & 5 deletions src/main/java/javax/time/calendar/LocalDate.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import static javax.time.calendar.ISODateTimeRule.MONTH_OF_YEAR;
import static javax.time.calendar.ISODateTimeRule.PACKED_EPOCH_MONTH_DAY;
import static javax.time.calendar.ISODateTimeRule.YEAR;
import static javax.time.calendar.ISODateTimeRule.ZERO_EPOCH_MONTH;
import static javax.time.calendar.ISODateTimeRule.EPOCH_MONTH;

import java.io.Serializable;

Expand Down Expand Up @@ -685,7 +685,7 @@ public LocalDate plus(PeriodProvider periodProvider) {
if (periodMonths == 0) {
return plusDays(periodDays); // optimization that also returns this for zero
}
long epm = PACKED_EPOCH_MONTH_DAY.extractISO(pemd, ZERO_EPOCH_MONTH);
long epm = toEpochMonth();
int day = getDayOfMonth();
long calcMonths = epm + periodMonths; // safe overflow
int newYear = YEAR.checkValidIntValue(MathUtils.floorDiv(calcMonths, 12) + 1970);
Expand Down Expand Up @@ -801,7 +801,7 @@ public LocalDate plusMonths(long months, DateResolver dateResolver) {
if (months == 0) {
return this;
}
long epm = PACKED_EPOCH_MONTH_DAY.extractISO(pemd, ZERO_EPOCH_MONTH);
long epm = toEpochMonth();
long calcMonths = epm + months; // safe overflow
int newYear = YEAR.checkValidIntValue(MathUtils.floorDiv(calcMonths, 12) + 1970);
MonthOfYear newMonth = MonthOfYear.of(MathUtils.floorMod(calcMonths, 12) + 1);
Expand Down Expand Up @@ -902,7 +902,7 @@ public LocalDate minus(PeriodProvider periodProvider) {
if (periodMonths == 0) {
return minusDays(periodDays); // optimization that also returns this for zero
}
long epm = PACKED_EPOCH_MONTH_DAY.extractISO(pemd, ZERO_EPOCH_MONTH);
long epm = toEpochMonth();
int day = getDayOfMonth();
long calcMonths = epm - periodMonths; // safe overflow
int newYear = YEAR.checkValidIntValue(MathUtils.floorDiv(calcMonths, 12) + 1970);
Expand Down Expand Up @@ -1018,7 +1018,7 @@ public LocalDate minusMonths(long months, DateResolver dateResolver) {
if (months == 0) {
return this;
}
long epm = PACKED_EPOCH_MONTH_DAY.extractISO(pemd, ZERO_EPOCH_MONTH);
long epm = toEpochMonth();
long calcMonths = epm - months; // safe overflow
int newYear = YEAR.checkValidIntValue(MathUtils.floorDiv(calcMonths, 12) + 1970);
MonthOfYear newMonth = MonthOfYear.of(MathUtils.floorMod(calcMonths, 12) + 1);
Expand Down Expand Up @@ -1067,6 +1067,10 @@ public LocalDate minusDays(long days) {
return LocalDate.ofModifiedJulianDay(mjDay);
}

private long toEpochMonth() {
return PACKED_EPOCH_MONTH_DAY.extractISO(pemd, EPOCH_MONTH);
}

//-----------------------------------------------------------------------
/**
* Checks whether this {@code LocalDate} matches the specified matcher.
Expand Down
Loading

0 comments on commit a12eaef

Please sign in to comment.