Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to subgants code that allows for computing end date. #15

Open
a-t-0 opened this issue Sep 6, 2022 · 0 comments
Open

Switch to subgants code that allows for computing end date. #15

a-t-0 opened this issue Sep 6, 2022 · 0 comments

Comments

@a-t-0
Copy link
Member

a-t-0 commented Sep 6, 2022

The code is given in abandoned private research project 6:

def get_end_date(
    subgantt, start_activity, end_activity, previous_end_date, print_min_duration
):
    duration = get_start_to_end_duration(subgantt, start_activity, end_activity)
    print(f"First duration={duration}")
    # duration = start_activity.duration_days
    duration = int(get_duration(start_activity, print_min_duration))
    print(f"activity duration={duration}")
    # exit()
    # get which days are countable
    countable_days = get_countable_days(subgantt)
    # get start date

    if not previous_end_date is None:
        activity_start_date = previous_end_date - datetime.timedelta(days=2)
    else:
        activity_start_date = get_activity_start_date(subgantt, start_activity)
    #    shift = previous_end_date - activity_start_date
    #    print(f"shift={shift}")
    #    print(f"shift={shift.days}")
    #    shifted_start_day = compute_end_day(
    #        activity_start_date, countable_days, shift.days
    #    )
    #    print(f"shifted_start_day={shifted_start_day}")
    #    print(f"activity_start_date={activity_start_date}")
    #    activity_start_date = shifted_start_day

    # compute end date.
    end_day = compute_end_day(activity_start_date, countable_days, duration)
    print(f"end_day={end_day}")
    return activity_start_date, end_day
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant