Returns holidays by year.
@param {number} year
@param {boolean} [includeWeekends] include holidays falling on a weekend (default: false)
@return {Array}
168280
function(year, includeWeekends) {
    initialize(year);

    includeWeekends = includeWeekends || false;

    var self = this;
    var holidays = [];

    if (!includeWeekends) {
      self.year.discardWeekends();
    }

    Object.keys(self.year.holidays).forEach(function(month) {
      self.year.holidays[month].forEach(function(holiday) {
        holidays.push(holiday);
      });
    });

    return holidays;
  }
196546
function(year) {
    var self = this;
    var month = 6;
    var midsummerEve;

    self.range(19, 26).forEach(function(day) {
      if (!midsummerEve) {
        var date = self.createDate(year, month, day);
        var dayOfWeek = self.getDayOfWeek(date);

        if (dayOfWeek === self.FRIDAY) {
          midsummerEve = date;
        }
      }
    });

    return midsummerEve;
  }
1132574
function () {
                if (this.Data.ExcludedDays == undefined || this.Data.ExcludedDays.length == 0)
                    return this.ExcludedWeekdays;
                return _.union(this.ExcludedWeekdays, this.ExcludedDaysDatePart);
            }
1040064
function(year) {
    var self = this;
    var date = this.easterSunday(year);
    var dayOfWeek = null;

    function resolveFriday() {
      if (dayOfWeek === self.FRIDAY) {
        return date;
      } else {
        date = self.subtractDays(date, 1);
        dayOfWeek = self.getDayOfWeek(date);
        return resolveFriday();
      }
    }

    return resolveFriday();
  }
1303639
public static Years<Weekcycle> between(CalendarWeek w1, CalendarWeek w2) {

        int delta = w2.getYear() - w1.getYear();

        if (delta > 0) {
            if (w2.getWeek() < w1.getWeek()) {
                delta--;
            }
        } else if (delta < 0) {
            if (w2.getWeek() > w1.getWeek()) {
                delta++;
            }
        }

        return Years.ofWeekBased(delta);

    }
606575
function(year) {
			var date = this._validate(year, this.minMonth, this.minDay, $.calendars.local.invalidYear);
			year = date.year();
			return this.toJD((year === -1 ? +1 : year + 1), 7, 1) - this.toJD(year, 7, 1);
		}
1294305
private Date seasonalDateFromIcs(String icsFileName, String eventSummary, int year) {
    Map<Integer, Date> dates = getDatesFromIcs(icsFileName, eventSummary, year, year);
    return dates.get(year - (eventSummary.equals(Holiday.NEW_YEARS_EVE.getSummary()) ? 1 : 0));
  }
76192
private void getYearlyDates(Calendar calendar, List<Date> dates)
   {
      if (m_relative)
      {
         getYearlyRelativeDates(calendar, dates);
      }
      else
      {
         getYearlyAbsoluteDates(calendar, dates);
      }
   }
786047
function getWeeks (date) {

                    var weeks = [];
                    var date = moment.utc(date);
                    var firstDayOfMonth = moment(date).date(1);
                    var lastDayOfMonth  = moment(date).date(date.daysInMonth());

                    var startDay = moment(firstDayOfMonth);
                    var endDay   = moment(lastDayOfMonth);
                    // NB: We use weekday() to get a locale aware weekday
                    startDay = firstDayOfMonth.weekday() === 0 ? startDay : startDay.weekday(0);
                    endDay   = lastDayOfMonth.weekday()  === 6 ? endDay   : endDay.weekday(6);

                    var currentWeek = [];

                    for (var start = moment(startDay); start.isBefore(moment(endDay).add(1, 'days')); start.add(1, 'days')) {

                        var afterMinDate  = !scope.config.minDate || start.isAfter(scope.config.minDate, 'day');
                        var beforeMaxDate = !scope.config.maxDate || start.isBefore(scope.config.maxDate, 'day');
                        var isFuture      = start.isAfter(today);
                        var beforeFuture  = scope.config.allowFuture || !isFuture;

                        var day = {
                            date: moment(start).toDate(),
                            isToday: start.isSame(today, 'day'),
                            isInMonth: start.isSame(firstDayOfMonth, 'month'),
                            isSelected: start.isSame(dateSelected, 'day'),
                            isSelectable: afterMinDate && beforeMaxDate && beforeFuture
                        };

                        currentWeek.push(day);

                        if (start.weekday() === 6 || start === endDay) {
                            weeks.push(currentWeek);
                            currentWeek = [];
                        }
                    }

                    return weeks;
                }
891162
public String getWeekdayOfMonth(int number, int weekday, int month, int year) {
		return getWeekdayRelativeTo(String.format("%04d-%02d-01", year, month), weekday, number, true);
	}
241483
def include?(date)
    return true if all_week?
    if @start_day < @end_day
      @start_day<=date.wday && @end_day>=date.wday
    else
      (@start_day<=date.wday && 6 >=date.wday) || (0 <=date.wday && @end_day >=date.wday)
    end
  end
1218338
static Predicate<DateValue> byDayFilter(
            final WeekdayNum[] days, final boolean weeksInYear, final Weekday wkst) {
        return new Predicate<DateValue>() {
            public boolean apply(DateValue date) {
                Weekday dow = Weekday.valueOf(date);

                int nDays;
                // first day of the week in the given year or month
                Weekday dow0;
                // where does date appear in the year or month?
                // in [0, lengthOfMonthOrYear - 1]
                int instance;
                if (weeksInYear) {
                    nDays = TimeUtils.yearLength(date.year());
                    dow0 = Weekday.firstDayOfWeekInMonth(date.year(), 1);
                    instance = TimeUtils.dayOfYear(
                            date.year(), date.month(), date.day());
                } else {
                    nDays = TimeUtils.monthLength(date.year(), date.month());
                    dow0 = Weekday.firstDayOfWeekInMonth(date.year(), date.month());
                    instance = date.day() - 1;
                }

                // which week of the year or month does this date fall on?
                // one-indexed
                int dateWeekNo;
                if (wkst.javaDayNum <= dow.javaDayNum) {
                    dateWeekNo = 1 + (instance / 7);
                } else {
                    dateWeekNo = (instance / 7);
                }

                // TODO(msamuel): according to section 4.3.10
                //     Week number one of the calendar year is the first week which
                //     contains at least four (4) days in that calendar year. This
                //     rule part is only valid for YEARLY rules.
                // That's mentioned under the BYWEEKNO rule, and there's no mention
                // of it in the earlier discussion of the BYDAY rule.
                // Does it apply to yearly week numbers calculated for BYDAY rules in
                // a FREQ=YEARLY rule?

                for (int i = days.length; --i >= 0; ) {
                    WeekdayNum day = days[i];

                    if (day.wday == dow) {
                        int weekNo = day.num;
                        if (0 == weekNo) {
                            return true;
                        }

                        if (weekNo < 0) {
                            weekNo = Util.invertWeekdayNum(day, dow0, nDays);
                        }

                        if (dateWeekNo == weekNo) {
                            return true;
                        }
                    }
                }
                return false;
            }
        };
    }
1137882
function(weekBeginDate) {
        var overlaps = false;
        var nextWeek = this.add(weekBeginDate, this.DAY, 6);
        if (nextWeek.getFullYear() != weekBeginDate.getFullYear()) {
            overlaps = true;
        }
        return overlaps;
    }
924337
public void seekToHolidayYear(String holidayString, String yearString) {
    Holiday holiday = Holiday.valueOf(holidayString);
    assert(holiday != null);
    
    seekToIcsEventYear(HOLIDAY_ICS_FILE, yearString, holiday.getSummary());
  }
78468
private function getNoWorkDaysWithinSingleYear(DateTime $firstDay, DateTime $lastDay, string $region, int $year, array $noWork): HolidayList
    {
        $holidays = [];
        $holidays[] = $this->holidayCalculator->calculateHolidaysForYear($year, $region, $firstDay->getTimezone());
        $temporaryHolidayCalculator = new HolidayCalculator(new WeekdayInitializer());
        foreach ($noWork as $noWorkDays) {
            $holidays[] = $temporaryHolidayCalculator->calculateHolidaysForYear($year, $noWorkDays->getId(), $firstDay->getTimezone());
        }

        $holidayList = $this->mergeHolidayLists($holidays);
        $holidayList = (
        new IncludeTimespanFilter(new IncludeUniqueDateFilter(new IncludeTypeFilter())))
            ->filter($holidayList, [
                IncludeTimespanFilter::PARAM_FIRST_DAY => $firstDay,
                IncludeTimespanFilter::PARAM_LAST_DAY => $lastDay,
                IncludeTypeFilter::PARAM_HOLIDAY_TYPE => HolidayType::DAY_OFF,
            ]);

        return $holidayList;
    }
53319
public function calculateHolidaysForYear($year, $region, DateTimeZone $timezone = null)
    {
        $this->init();
        if (!isset($this->holidayProviders[$region])) {
            throw new HolidayException('Invalid location alias: '.$region);
        }
        $holidays = $this->holidayProviders[$region]->calculateHolidaysForYear($year, $timezone);

        return $holidays;
    }
983701
function getHolidays(year) {
  var holidays = holidayCache[year];
  if (holidays) {
    return holidays;
  }

  // 祝日を計算し追加
  holidays = {};

  var furikae = false;
  var kokumin = false;

  HOLIDAYS.forEach(item => {
    var h;
    switch (item) {
    case '春分の日':
      h = getShunbun(year);
      break;
    case '秋分の日':
      h = getShubun(year);
      break;
    case '振替休日':
      furikae = true;
      break;
    case '国民の休日':
      kokumin = true;
      break;

    default:
      h = parseHoliday(year, item);
      break;
    }
    if (h) {
      var key = h[0] * 100 + h[1];
      holidays[key] = h[2];
    }
  });

  // 振替休日を設定
  if (furikae) {
    setFurikaeKyujitu(year, holidays);
  }

  // 国民の休日を設定
  if (kokumin) {
    setKokuminNoKyujitu(year, holidays);
  }

  // キャッシュに保存
  holidayCache[year] = holidays;

  return holidays;
}