Lines Matching refs:year

71 * Due to the rules for postponing the start of the year to avoid having
72 * certain holidays fall on the sabbath, the year can end up being three
93 * The cumulative # of days to the end of each month in a non-leap year
117 * The cumulative # of days to the end of each month in a leap year
228 int32_t year = get(UCAL_YEAR, status);
234 if (acrossAdar1 && month>=ADAR_1 && !isLeapYear(year)) {
241 ++year;
248 if (acrossAdar1 && month<=ADAR_1 && !isLeapYear(year)) {
255 --year;
260 set(UCAL_YEAR, year);
320 int32_t year = get(UCAL_YEAR, status);
322 UBool leapYear = isLeapYear(year);
323 int32_t yearLength = monthsInYear(year);
326 // If it's not a leap year and we're rolling past the missing month
359 // It is used to calculate the approximate year and month of a given
365 // The time of the new moon (in parts) on 1 Tishri, year 1 (the epoch)
371 * Finds the day # of the first day in the given Hebrew year.
373 * in that year.
390 int32_t HebrewCalendar::startOfYear(int32_t year, UErrorCode &status)
393 int32_t day = CalendarCache::get(&gCache, year, status);
396 int32_t months = (235 * year - 234) / 19; // # of months before year
409 if (wd == 1 && frac > 15*HOUR_PARTS+204 && !isLeapYear(year) ) {
411 // on a Tuesday and it is not a leap year, postpone by 2 days.
415 else if (wd == 0 && frac > 21*HOUR_PARTS+589 && isLeapYear(year-1) ) {
417 // on a Monday and *last* year was a leap year, postpone by 1 day.
421 CalendarCache::put(&gCache, year, day, status);
439 * Returns the the type of a given year.
440 * 0 "Deficient" year with 353 or 383 days
441 * 1 "Normal" year with 354 or 384 days
442 * 2 "Complete" year with 355 or 385 days
444 int32_t HebrewCalendar::yearType(int32_t year) const
446 int32_t yearLength = handleGetYearLength(year);
462 //throw new RuntimeException("Illegal year length " + yearLength + " in year " + year);
469 * Determine whether a given Hebrew year is a leap year
471 * The rule here is that if (year % 19) == 0, 3, 6, 8, 11, 14, or 17.
474 UBool HebrewCalendar::isLeapYear(int32_t year) {
475 //return (year * 12 + 17) % 19 >= 12;
476 int32_t x = (year*12 + 17) % 19;
480 int32_t HebrewCalendar::monthsInYear(int32_t year) {
481 return isLeapYear(year) ? 13 : 12;
496 * Returns the length of the given month in the given year
501 // obtain the correct year. We correct to
502 // a 12- or 13-month year (add/subtract 12 or 13, depending
503 // on the year) but since we _always_ number from 0..12, and
504 // the leap year determines whether or not month 5 (Adar 1)
505 // is present, we allow 0..12 in any given year.
527 * Returns the number of days in the given Hebrew year
570 int32_t year = (int32_t)( ((19. * m + 234.) / 235.) + 1.); // Years (approx)
571 int32_t ys = startOfYear(year, status); // 1st day of year
576 year--;
577 ys = startOfYear(year, status);
582 int32_t type = yearType(year);
583 UBool isLeap = isLeapYear(year);
607 internalSet(UCAL_YEAR, year);
608 internalSet(UCAL_EXTENDED_YEAR, year);
622 int32_t year;
624 year = internalGet(UCAL_EXTENDED_YEAR, 1); // Default to year 1
626 year = internalGet(UCAL_YEAR, 1); // Default to year 1
628 return year;
632 * Return JD of start of given month/year.
638 // obtain the correct year. We correct to
639 // a 12- or 13-month year (add/subtract 12 or 13, depending
640 // on the year) but since we _always_ number from 0..12, and
641 // the leap year determines whether or not month 5 (Adar 1)
642 // is present, we allow 0..12 in any given year.
684 * and year are set, they do not change.