/** * Normalizes the date by carrying over to the year any months outside 1..12 * and carrying over to the month any days outside 1..(days-in-month). */ private void _normalizeDate() { if (_M < 1 || _M > 12 || _D < 1 || _D > _maxDayInMonthFor(_CY, _M)) { // fix months first int temp = _M; _M = _modulo(temp, 1, 13); _CY = _CY + (int)_fQuotient(temp, 1, 13); // then pull days out int extradays = _D - 1; _D = 1; // then use the julian date function to fix setJulianDate(getJulianDate() + extradays); } }
_M = _modulo(temp, 1, 13); _CY = _CY + sign * year + (int)_fQuotient(temp, 1, 13);
private void _normalizeTimeAndDate() { long carry = 0; if (hasTime()) carry = _normalizeTime(); if (hasDay()) _D += carry; if (hasDate()) { _normalizeDate(); } else if (hasMonth()) { // with incomplete dates, just months can be normalized: // days stay denormalized. if (_M < 1 || _M > 12) { int temp = _M; _M = _modulo(temp, 1, 13); if (hasYear()) _CY = _CY + (int)_fQuotient(temp, 1, 13); } } }
/** * Normalizes the date by carrying over to the year any months outside 1..12 * and carrying over to the month any days outside 1..(days-in-month). */ private void _normalizeDate() { if (_M < 1 || _M > 12 || _D < 1 || _D > _maxDayInMonthFor(_CY, _M)) { // fix months first int temp = _M; _M = _modulo(temp, 1, 13); _CY = _CY + (int)_fQuotient(temp, 1, 13); // then pull days out int extradays = _D - 1; _D = 1; // then use the julian date function to fix setJulianDate(getJulianDate() + extradays); } }
/** * Normalizes the date by carrying over to the year any months outside 1..12 * and carrying over to the month any days outside 1..(days-in-month). */ private void _normalizeDate() { if (_M < 1 || _M > 12 || _D < 1 || _D > _maxDayInMonthFor(_CY, _M)) { // fix months first int temp = _M; _M = _modulo(temp, 1, 13); _CY = _CY + (int)_fQuotient(temp, 1, 13); // then pull days out int extradays = _D - 1; _D = 1; // then use the julian date function to fix setJulianDate(getJulianDate() + extradays); } }
_M = _modulo(temp, 1, 13); _CY = _CY + sign * year + (int)_fQuotient(temp, 1, 13);
_M = _modulo(temp, 1, 13); _CY = _CY + sign * year + (int)_fQuotient(temp, 1, 13);
_M = _modulo(temp, 1, 13); if (hasYear()) _CY = _CY + (int)_fQuotient(temp, 1, 13);
private void _normalizeTimeAndDate() { long carry = 0; if (hasTime()) carry = _normalizeTime(); if (hasDay()) _D += carry; if (hasDate()) { _normalizeDate(); } else if (hasMonth()) { // with incomplete dates, just months can be normalized: // days stay denormalized. if (_M < 1 || _M > 12) { int temp = _M; _M = _modulo(temp, 1, 13); if (hasYear()) _CY = _CY + (int)_fQuotient(temp, 1, 13); } } }