Utilities

convertdate.utils.amod(a, b)

Modulus function which returns numerator if modulus is zero

convertdate.utils.ceil(x)
convertdate.utils.floor(x)
convertdate.utils.jwday(j)

Calculate day of week from Julian day. Consider using calendar.weekday!

convertdate.utils.monthcalendarhelper(start_weekday, month_length)
convertdate.utils.n_weeks(weekday, jd, nthweek)
convertdate.utils.nearest_weekday(weekday, jd)
convertdate.utils.next_or_current_weekday(weekday, jd)
convertdate.utils.next_weekday(weekday, jd)
convertdate.utils.nth_day_of_month(n, weekday, month, year)

Return (year, month, day) tuple that represents nth weekday of month in year. If n==0, returns last weekday of month. Weekdays: Monday=0

convertdate.utils.previous_or_current_weekday(weekday, jd)
convertdate.utils.previous_weekday(weekday, jd)
convertdate.utils.search_weekday(weekday, jd, direction, offset)

Determine the Julian date for the next or previous weekday

Arguments:

weekday (int): Day of week desired, 0 = Monday jd (float): Julian date to begin search direction(int): 1 = next weekday, -1 = last weekday offset(int): Offset from jd to begin search.

convertdate.utils.weekday_before(weekday, jd)