Beispiel #1
0
def calcStartReleaseDatesForVersions(versions):
    """
	calculates the Start/Release Dates for VERSIONS and sets them back to the obj
	:param versions: list of dicts
	:return:
	"""

    lastReleaseDate = ""
    for index, version in enumerate(versions):
        if index == 0:
            duration = int(version["duration"])
            releaseFull = dateHandler.date_by_adding_business_days(
                datetime.datetime(dateTODAY.year, dateTODAY.month, dateTODAY.day), duration, dateHandler.Holidays
            )
            releaseDate = "%s-%s-%s" % (releaseFull.year, releaseFull.month, releaseFull.day)

            lastReleaseDate = releaseDate
            version["releasedate"] = releaseDate
        else:
            version["startdate"] = lastReleaseDate  # set startdate for this version
            duration = int(version["duration"])
            startYear = int(lastReleaseDate[:4])  # year as int
            startMonth = int(lastReleaseDate.partition("-")[-1].rpartition("-")[0])  # month as int
            startDay = int(lastReleaseDate.rpartition("-")[-1])  # day as int
            releaseFull = dateHandler.date_by_adding_business_days(
                datetime.datetime(startYear, startMonth, startDay), duration, dateHandler.Holidays
            )
            releaseDate = "%s-%s-%s" % (releaseFull.year, releaseFull.month, releaseFull.day)

            lastReleaseDate = releaseDate
            version["releasedate"] = releaseDate

    return
Beispiel #2
0
def calcReleaseDate(prevRelease, currentDuration):
    date = dateHandler.date_by_adding_business_days(
        dateHandler.datetime.datetime(dateHandler.dateTODAY.year,
                                      dateHandler.dateTODAY.month,
                                      dateHandler.dateTODAY.day), 10,
        dateHandler.Holidays)
    releaseDate = "%s-%s-%s" % (date.year, date.month, date.day)
    return releaseDate
Beispiel #3
0
def calcReleaseDate(prevRelease, currentDuration):
    date = dateHandler.date_by_adding_business_days(
        dateHandler.datetime.datetime(
            dateHandler.dateTODAY.year, dateHandler.dateTODAY.month, dateHandler.dateTODAY.day
        ),
        10,
        dateHandler.Holidays,
    )
    releaseDate = "%s-%s-%s" % (date.year, date.month, date.day)
    return releaseDate
Beispiel #4
0
def calcStartReleaseDatesForVersions(versions):
    """
	calculates the Start/Release Dates for VERSIONS and sets them back to the obj
	:param versions: list of dicts
	:return:
	"""

    lastReleaseDate = ""
    for index, version in enumerate(versions):
        if index == 0:
            duration = int(version['duration'])
            releaseFull = dateHandler.date_by_adding_business_days(
                datetime.datetime(dateTODAY.year, dateTODAY.month,
                                  dateTODAY.day), duration,
                dateHandler.Holidays)
            releaseDate = (
                "%s-%s-%s" %
                (releaseFull.year, releaseFull.month, releaseFull.day))

            lastReleaseDate = releaseDate
            version['releasedate'] = releaseDate
        else:
            version[
                'startdate'] = lastReleaseDate  #set startdate for this version
            duration = int(version['duration'])
            startYear = int(lastReleaseDate[:4])  #year as int
            startMonth = (int(
                lastReleaseDate.partition('-')[-1].rpartition('-')[0])
                          )  #month as int
            startDay = (int(lastReleaseDate.rpartition('-')[-1]))  #day as int
            releaseFull = dateHandler.date_by_adding_business_days(
                datetime.datetime(startYear, startMonth, startDay), duration,
                dateHandler.Holidays)
            releaseDate = (
                "%s-%s-%s" %
                (releaseFull.year, releaseFull.month, releaseFull.day))

            lastReleaseDate = releaseDate
            version['releasedate'] = releaseDate

    return