Lines Matching refs:year
41 { -5000000, -5000000, 5000000, 5000000}, // YEAR
68 * Due to the rules for postponing the start of the year to avoid having
69 * certain holidays fall on the sabbath, the year can end up being three
90 * The cumulative # of days to the end of each month in a non-leap year
114 * The cumulative # of days to the end of each month in a leap year
225 int32_t year = get(UCAL_YEAR, status);
231 if (acrossAdar1 && month>=ADAR_1 && !isLeapYear(year)) {
238 ++year;
245 if (acrossAdar1 && month<=ADAR_1 && !isLeapYear(year)) {
252 --year;
257 set(UCAL_YEAR, year);
317 int32_t year = get(UCAL_YEAR, status);
319 UBool leapYear = isLeapYear(year);
320 int32_t yearLength = monthsInYear(year);
323 // If it's not a leap year and we're rolling past the missing month
356 // It is used to calculate the approximate year and month of a given
362 // The time of the new moon (in parts) on 1 Tishri, year 1 (the epoch)
368 * Finds the day # of the first day in the given Hebrew year.
370 * in that year.
387 int32_t HebrewCalendar::startOfYear(int32_t year, UErrorCode &status)
390 int32_t day = CalendarCache::get(&gCache, year, status);
393 int32_t months = (235 * year - 234) / 19; // # of months before year
406 if (wd == 1 && frac > 15*HOUR_PARTS+204 && !isLeapYear(year) ) {
408 // on a Tuesday and it is not a leap year, postpone by 2 days.
412 else if (wd == 0 && frac > 21*HOUR_PARTS+589 && isLeapYear(year-1) ) {
414 // on a Monday and *last* year was a leap year, postpone by 1 day.
418 CalendarCache::put(&gCache, year, day, status);
436 * Returns the the type of a given year.
437 * 0 "Deficient" year with 353 or 383 days
438 * 1 "Normal" year with 354 or 384 days
439 * 2 "Complete" year with 355 or 385 days
441 int32_t HebrewCalendar::yearType(int32_t year) const
443 int32_t yearLength = handleGetYearLength(year);
459 //throw new RuntimeException("Illegal year length " + yearLength + " in year " + year);
466 * Determine whether a given Hebrew year is a leap year
468 * The rule here is that if (year % 19) == 0, 3, 6, 8, 11, 14, or 17.
471 UBool HebrewCalendar::isLeapYear(int32_t year) {
472 //return (year * 12 + 17) % 19 >= 12;
473 int32_t x = (year*12 + 17) % 19;
477 int32_t HebrewCalendar::monthsInYear(int32_t year) {
478 return isLeapYear(year) ? 13 : 12;
493 * Returns the length of the given month in the given year
498 // obtain the correct year. We correct to
499 // a 12- or 13-month year (add/subtract 12 or 13, depending
500 // on the year) but since we _always_ number from 0..12, and
501 // the leap year determines whether or not month 5 (Adar 1)
502 // is present, we allow 0..12 in any given year.
524 * Returns the number of days in the given Hebrew year
541 * <li>YEAR
560 int32_t year = (int32_t)( ((19. * m + 234.) / 235.) + 1.); // Years (approx)
561 int32_t ys = startOfYear(year, status); // 1st day of year
566 year--;
567 ys = startOfYear(year, status);
572 int32_t type = yearType(year);
573 UBool isLeap = isLeapYear(year);
597 internalSet(UCAL_YEAR, year);
598 internalSet(UCAL_EXTENDED_YEAR, year);
612 int32_t year;
614 year = internalGet(UCAL_EXTENDED_YEAR, 1); // Default to year 1
616 year = internalGet(UCAL_YEAR, 1); // Default to year 1
618 return year;
622 * Return JD of start of given month/year.
628 // obtain the correct year. We correct to
629 // a 12- or 13-month year (add/subtract 12 or 13, depending
630 // on the year) but since we _always_ number from 0..12, and
631 // the leap year determines whether or not month 5 (Adar 1)
632 // is present, we allow 0..12 in any given year.