Return the Hebrew day of week for Rosh Hashana.
966362
def rosh_hashana_dow(self):
        """"""
        jdn = conv.hdate_to_jdn(HebrewDate(self.hdate.year, Months.Tishrei, 1))
        return (jdn + 1) % 7 + 1
420616
public Weekday getDayOfWeek() {

        Weekday dow = this.weekday;

        if (dow == null) {
            dow = Weekday.valueOf(GregorianMath.getDayOfWeek(this.year, this.month, this.dayOfMonth));
        }

        return dow;

    }
1146030
public static function getWeekdays() {
		return array(
			self::MONDAY,
			self::TUESDAY,
			self::WEDNESDAY,
			self::THURSDAY,
			self::FRIDAY,
			self::SATURDAY,
			self::SUNDAY,
		);
	}
169220
def month_days(year, month):
    ''''''
    if month > 13:
        raise ValueError("Incorrect month index")

    # First of all, dispose of fixed-length 29 day months
    if month in (IYYAR, TAMMUZ, ELUL, TEVETH, VEADAR):
        return 29

    # If it's not a leap year, Adar has 29 days
    if month == ADAR and not leap(year):
        return 29

    # If it's Heshvan, days depend on length of year
    if month == HESHVAN and (year_days(year) % 10) != 5:
        return 29

    # Similarly, Kislev varies with the length of year
    if month == KISLEV and (year_days(year) % 10) == 3:
        return 29

    # Nope, it's a 30 day month
    return 30
1174423
private int getDaysToNextMatch(WeekDay weekDay) {

        for (WeekDay wd : m_weekDays) {
            if (wd.compareTo(weekDay) > 0) {
                return wd.toInt() - weekDay.toInt();
            }
        }
        return (m_weekDays.iterator().next().toInt() + (m_interval * I_CmsSerialDateValue.NUM_OF_WEEKDAYS))
            - weekDay.toInt();
    }
1197492
def first_sunday(self, year, month):
        """"""
        date = datetime(year, month, 1, 0)
        days_until_sunday = 6 - date.weekday()

        return date + timedelta(days=days_until_sunday)
676006
def jdn_to_hdate(jdn):
    """"""
    # calculate Gregorian date
    date = jdn_to_gdate(jdn)

    # Guess Hebrew year is Gregorian year + 3760
    year = date.year + 3760

    jdn_tishrey1 = hdate_to_jdn(HebrewDate(year, 1, 1))
    jdn_tishrey1_next_year = hdate_to_jdn(HebrewDate(year + 1, 1, 1))

    # Check if computed year was underestimated
    if jdn_tishrey1_next_year <= jdn:
        year = year + 1
        jdn_tishrey1 = jdn_tishrey1_next_year
        jdn_tishrey1_next_year = hdate_to_jdn(HebrewDate(year + 1, 1, 1))

    size_of_year = get_size_of_hebrew_year(year)

    # days into this year, first month 0..29
    days = jdn - jdn_tishrey1

    # last 8 months always have 236 days
    if days >= (size_of_year - 236):  # in last 8 months
        days = days - (size_of_year - 236)
        month = days * 2 // 59
        day = days - (month * 59 + 1) // 2 + 1

        month = month + 4 + 1

        # if leap
        if size_of_year > 355 and month <= 6:
            month = month + 8
    else:  # in 4-5 first months
        # Special cases for this year
        if size_of_year % 10 > 4 and days == 59:   # long Heshvan (day 30)
            month = 1
            day = 30
        elif size_of_year % 10 > 4 and days > 59:  # long Heshvan
            month = (days - 1) * 2 // 59
            day = days - (month * 59 + 1) // 2
        elif size_of_year % 10 < 4 and days > 87:  # short kislev
            month = (days + 1) * 2 // 59
            day = days - (month * 59 + 1) // 2 + 2
        else:  # regular months
            month = days * 2 // 59
            day = days - (month * 59 + 1) // 2 + 1

        month = month + 1

    return HebrewDate(year, month, day)
538767
def monthdayscalendar(cls, year, month):
        """"""
        weeks = []
        week = []
        for day in NepCal.itermonthdays(year, month):
            week.append(day)
            if len(week) == 7:
                weeks.append(week)
                week = []
        if len(week) > 0:
            weeks.append(week)
        return weeks
1110030
private BigInteger getDaysOfTheWeek(RecurringData data)
   {
      int value = 0;
      for (Day day : Day.values())
      {
         if (data.getWeeklyDay(day))
         {
            value = value | DAY_MASKS[day.getValue()];
         }
      }
      return BigInteger.valueOf(value);
   }
233789
private static function jdMonthNameJewishMonths($julian_day)
    {
        list(, , $year) = explode('/', self::jdToCalendar(self::$jewish_calendar, $julian_day, 347998, 324542846));

        if (self::$jewish_calendar->isLeapYear($year)) {
            return self::shouldEmulateBug54254() ? self::$MONTH_NAMES_JEWISH_54254 : self::$MONTH_NAMES_JEWISH_LEAP_YEAR;
        } else {
            return self::shouldEmulateBug54254() ? self::$MONTH_NAMES_JEWISH_54254 : self::$MONTH_NAMES_JEWISH;
        }
    }
102497
public static HebrewTime ofDigital(
        int hour23,
        int part
    ) {

        if (hour23 < 0 || hour23 > 23) {
            throw new IllegalArgumentException(
                "DIGITAL_HOUR out of range: " + hour23);
        }

        if (part < 0 || part >= PARTS_IN_HOUR) {
            throw new IllegalArgumentException(
                "PART_OF_HOUR out of range: " + part);
        }

        return new HebrewTime(hour23, part);

    }
501725
def next_haab(month, jd):
    ''''''
    if jd < EPOCH:
        raise IndexError("Input day is before Mayan epoch.")

    hday, hmonth = to_haab(jd)

    if hmonth == month:
        days = 1 - hday

    else:
        count1 = _haab_count(hday, hmonth)
        count2 = _haab_count(1, month)

        # Find number of days between haab of given jd and desired haab
        days = (count2 - count1) % 365

    # add in the number of days and return new jd
    return jd + days
634415
def prev_weekday(weekday):
    """"""
    ix = WEEKDAYS.index(weekday)
    if ix == 0:
        return WEEKDAYS[len(WEEKDAYS)-1]
    return WEEKDAYS[ix-1]
495956
function(opts, day, abbr)
    {
        day += opts.firstDay;
        while (day >= 7) {
            day -= 7;
        }
        return abbr ? opts.i18n.weekdaysShort[day] : opts.i18n.weekdays[day];
    }
982851
def verify_weekday(self, now):
        ''''''
        return self.weekdays == "*" or str(now.weekday()) in self.weekdays.split(" ")
293629
def pday(dayfmt):
	

	year, month, day = map(int, dayfmt.split('-'))
	return '{day} the {number}'.format(
		day=calendar.day_name[calendar.weekday(year, month, day)],
		number=inflect.engine().ordinal(day),
	)
249099
public function dayNames(int $day_number): string
    {
        static $translated_day_names;

        if ($translated_day_names === null) {
            $translated_day_names = [
                0 => I18N::translate('Monday'),
                1 => I18N::translate('Tuesday'),
                2 => I18N::translate('Wednesday'),
                3 => I18N::translate('Thursday'),
                4 => I18N::translate('Friday'),
                5 => I18N::translate('Saturday'),
                6 => I18N::translate('Sunday'),
            ];
        }

        return $translated_day_names[$day_number];
    }