Example #1
0
def bizDatesList(holidayCenter, fromDate, toDate):
    cal = Calendar(holidayCenter)
    fromDate = check_date(fromDate)
    toDate = check_date(toDate)
    assert fromDate <= toDate, "from date ({0} must be earlier than to date {1}".format(
        fromDate, toDate)
    return [d.toDateTime() for d in cal.bizDatesList(fromDate, toDate)]
Example #2
0
def makeSchedule(firstDate, endDate, tenor):
    cal = Calendar('NullCalendar')
    firstDate = check_date(firstDate)
    endDate = check_date(endDate)
    tenor = Period(tenor)
    schedule = Schedule(firstDate, endDate, tenor, cal)
    return [d.toDateTime() for d in schedule]
Example #3
0
def makeSchedule(firstDate, endDate, tenor):
    cal = Calendar('NullCalendar')
    firstDate = check_date(firstDate)
    endDate = check_date(endDate)
    tenor = Period(tenor)
    schedule = Schedule(firstDate, endDate, tenor, cal)
    return [d.toDateTime() for d in schedule]
Example #4
0
def datesList(fromDate, toDate):
    fromDate = check_date(fromDate)
    toDate = check_date(toDate)
    assert fromDate <= toDate, "from date ({0} must be earlier than to date {1}".format(
        fromDate, toDate)
    return [
        Date.fromExcelSerialNumber(serial).toDateTime()
        for serial in range(fromDate.serialNumber, toDate.serialNumber + 1)
    ]
Example #5
0
def makeSchedule(firstDate,
                 endDate,
                 tenor,
                 calendar='NullCalendar',
                 dateRule=BizDayConventions.Following):

    cal = Calendar(calendar)
    firstDate = check_date(firstDate)
    endDate = check_date(endDate)
    tenor = Period(tenor)
    schedule = Schedule(firstDate, endDate, tenor, cal, convention=dateRule)
    return [d.toDateTime() for d in schedule]
Example #6
0
def advanceDateByCalendar(holidayCenter,
                          referenceDate,
                          period,
                          convention=BizDayConventions.Following):
    cal = Calendar(holidayCenter)
    refer = check_date(referenceDate)
    return cal.advanceDate(refer, period, convention).toDateTime()
Example #7
0
def advanceDateByCalendar(holidayCenter, referenceDate, period, convention=BizDayConventions.Following):
    cal = Calendar(holidayCenter)
    refer = check_date(referenceDate)
    return cal.advanceDate(refer, period, convention).toDateTime()
Example #8
0
def advanceDate(referenceDate, period):
    d = check_date(referenceDate) + period
    return d.toDateTime()
Example #9
0
def holDatesList(holidayCenter, fromDate, toDate, includeWeekend=True):
    cal = Calendar(holidayCenter)
    fromDate = check_date(fromDate)
    toDate = check_date(toDate)
    assert fromDate <= toDate, "from date ({0} must be earlier than to date {1}".format(fromDate, toDate)
    return [d.toDateTime() for d in cal.holDatesList(fromDate, toDate, includeWeekend)]
Example #10
0
def datesList(fromDate, toDate):
    fromDate = check_date(fromDate)
    toDate = check_date(toDate)
    assert fromDate <= toDate, "from date ({0} must be earlier than to date {1}".format(fromDate, toDate)
    return [Date.fromExcelSerialNumber(serial).toDateTime() for serial in
            range(fromDate.serialNumber, toDate.serialNumber + 1)]
Example #11
0
def isBizDay(holidayCenter, ref):
    cal = Calendar(holidayCenter)
    ref = check_date(ref)
    return cal.isBizDay(ref)
Example #12
0
def advanceDate(referenceDate, period):
    d = check_date(referenceDate) + period
    return d.toDateTime()
Example #13
0
def isBizDay(holidayCenter, ref):
    cal = Calendar(holidayCenter)
    ref = check_date(ref)
    return cal.isBizDay(ref)