Content
View differences
Updated by Jens Ulferts almost 4 years ago
**As** an OpenProject user
**I want** to calculate the work package start and end dates based on the duration
**so** that I only have to set the duration.
# **Acceptance criteria:**
The duration feature affects a range of views and modules:
### Work package attributes and date picker
* In the date picker modal there is a text field `duration`.
* When the user enters a duration, the dates are derived.
* The contrary is also true: when a user enters dates, the duration is derived.
* More precise scenarios for what is derived/calculated as a result of what input (in which order), are [presented below](https://community.openproject.org/#scenarios).
* The duration represents the amount of days between the start and the finish date (inclusive):
* Monday to Tuesday: 2 days
* Monday to Monday (same day): 1 day
* Duration is always in full days (never floating point values).
* Once configuring non-working days is implemented (<mention class="mention" data-id="18416" data-type="work_package" data-text="#18416">#18416</mention>), these non-working days are _skipped_ _over_ and do not count towards the total duration:
* Friday to Monday: 2 days _(Saturday and Sunday are skipped over)_
* The user is able to override configured non-working days per work package; this means non-working can be optionally included, in which case they are _not_ skipped and count towards the date and duration count. More details in the [feature describing the datepicker](https://community.openproject.org/work_packages/41341) (<mention class="mention" data-id="41341" data-type="work_package" data-text="#41341">#41341</mention>).
* In all cases, the duration is consistent with the start and the finish date. Updating dates will update duration, and updating duration will update dates.
* It will not possible, for example, to specify a duration of 8 days for a task that starts and finishes the same week.
* The duration as well as start and due dates can not be configured via the form configuration. They are always present at the same place within the work package show page and form.
* This will be updated with <mention class="mention" data-id="40539" data-type="work_package" data-text="#40539">#40539</mention>.
* New work packages have an empty (not set) default duration
* unless the user has enabled the setting to give new work packages the current day (today) as the start date. In this case, this setting is respected.
* Certain date/duration information is derived (third value when two fields are filled).
* Setting start _and_ end dates automatically sets duration.
* Setting only one of the dates does not automatically set duration (unable to derive).
* Setting only one of the dates plus the duration sets the other date (derived).
* It is possible to have _only one attribute_ (only start date, only finish date or only duration) or all three. It is not possible to have just two (since the third will be derived from the other two).
* Concretely, these are **possible**:
* Duration specified; no start date; no finish dates is possible.
* A start date specified; no finish date; no duration is possible.
* A finish date specified; no start date; no duration is possible
* But these are **not possible**:
* A start date specified; duration specified; no end date is _not possible_. (End date is derived)
* A finish date specified; duration specified; no start date is _not possible_. (Start date is derived)
* A duration specified, start date specified, no finish date is _not possible_. (End date is derived)
* A duration specified, finish date specified, no start date is _not possible_. (Start date is derived).
* Milestone-typed work packages don't have a duration field.
* Still displayed as a diamond in the GANTT. In the team planner = 1 day.
* Uses the "simple" date picker, with just one date field and no duration.
* **\[open\]** Should it "take" a day, when scheduling? Currently it does, but perhaps it's wrong?
* The user has to to be informed when:
* Dates are automatically derived from relations (notably from parents or children),
* The user is always given a way to view relations, via an information banner (see <mention class="mention" data-id="41341" data-type="work_package" data-text="#41341">#41341</mention>).
* these automatically derived dates can not be modified, _unless_ manual scheduling is enabled, and thus relations are ignored.
* Schedules can be updated by moving certain work packages, within these limits:
* The parent's start and finish dates are determined by those of children (it will always that the start date of the earlist child and the finish date of the latest one).
* A work package A that has a _preceeds_ relationship with another one B, is limited to start/finish dates earlier than those of B.
* A work package Y that has a _follows_ relationship with another one X, is limited to start/finish dates later than those of X.
* _**\[open, need to discuss\]** However, it is always possible to modify a schedule by modifying the start/finish dates of the an earlier work package in a series of relationships to update all the ones that follow._
* _Naturally, this is as long as the work package being moved is not moved before the dates of another package preceeding it._
* _In other words, moving a preeceding work package can move following packages, but the opposite is not possible._
### Work package table view
* In the work packages list there is a column "duration". When clicking on this, the date modal with the date picker is opened, with the focus on the duration field.
* Ideally **\[open\]** How does the value is displayed with the value followed by the unit as a full word "days" (and "jours", "Tage" and so forth) handling pluralisation correctly. If duration field look like? As we don't already currently only have a system implemented time intervals in place hours, the values are not easily understandable. The suggestion is to do that, we can fall back on "d" (and "j", and "t" and so forth) have the value displayed like this: "\[value\] d".
* Filtering by duration is possible
* Sorting by duration is possible
### GANTT chart
* For work packages without start/finish dates but _with_ duration, the width of a "strip" representing such a work package on hover on a GANTT view has a width that is relative to its total duration (on drag over GANTT).
* "Relative" because width depends on the zoom level of the GANTT chart.
* On click, end date is calculated based on the the start date selected.
* If the duration is very long one (finish date is outside of current view), the user will first have to click to commit, and then zoom out or scroll to view the finish date.
* If the user modifies a work package via the drag handles on the left/right edges of the strips the in Gantt chart, both the start/finish date as well as the duration are altered in lockstep, based on which side is dragged.
* If non-working are included for that work package (via the date-picker), they will need to be taken into account in the GANTT too (for example, the work package should span the weekend if the weekend is included).
### Team planner
* For work packages without start/finish dates but _with_ duration, the width of a card that is dragged onto the team planner (from the left-hand "Add Existing" panel, for example) is relative to the total duration of that work package.
* "Relative" because width depends on the zoom level/view of the team planner calendar.
* If the user modifies a work package via the drag handles on the left/right edges of the cards on the Team planner, both the start/finish date as well as the duration are altered in lockstep.
* ~~**\[open\]** The user is able to modify the view such that weekends are not displayed on the team planner.~~
* ~~Even when weekends are not displayed, they are nevertheless represented (although with much narrower column widths and without a header).~~
* ~~This is especially important because manual scheduling nevertheless allows users to include non-working days into the date and duration count.~~
# Open
* Visuals for the rework of the dates & duration to be a fixed (not configurable) part of the work package show page and form (<mention class="mention" data-id="40539" data-type="work_package" data-text="#40539">#40539</mention>)
* Inheritance of the duration between a work package and its children
* e.g. can a work package have a duration that is less than the duration of its child. Only with manually scheduled.
* Normally a parent cannot have its own date values set by the user (unless manually scheduled).
* How will the duration be reflected in the activity, assuming that duration should be part of the activity? Naively the attributes start/finish and duration would all be displayed individually which might not be ideal.
* The duration would also be an additional activity that is displayed, if the duration is altered.
# Scenarios
## Scenario 1:
* Setup.
* Start date: Monday, February 8, 2021
* Finish date: empty
* Duration: empty
* Change
* User enters a duration of 10 days (duration in focus)
* Expected result:
* The finish date is set Friday, February 19 2021 (derived)
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31047/content"></div></figure>
## Scenario 2
* Setup
* Start date: empty
* Finish date: empty
* Duration: empty
* Change
* User enters a duration of 10 days
* Expected result:
* No date is added
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31048/content"></div></figure>
## Scenario 3
* Setup
* Start date: empty
* Finish date: Friday, February 19, 2021
* Duration: empty
* Change
* User enters a duration of 10 days (duration in focus).
* Expected result:
* The start date is set to Monday, February 8, 2021 (derived)
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31049/content"></div></figure>
## Scenario 4
* Setup
* Start date: Monday, February 8, 2021
* Finish date: Friday, February 19, 2021
* Duration: 10
* Change
* User changes duration to 11 days (duration in focus).
* Expected result:
* The finish date is changed to Monday, February, 22 2021
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31050/content"></div></figure>
## Scenario 5
* Setup
* Start date: Monday, February 8, 2021
* Finish date: Monday, February 22, 2021
* Duration: 11
* Change
* User changes duration to 10 days (duration in focus)
* Expected result:
* The finish date is changed to Friday, February, 19, 2021
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31051/content"></div></figure>
## Scenario 6
* Setup
* Start date: Tuesday, February 9, 2021
* Finish date: Friday, February 12, 2021
* Change
* Remove duration.
* Expected result
* Finish date is also removed, start date is maintained as is.
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31052/content"></div></figure>
## Scenario 7
* Setup
* Start date: Monday, February 8, 2021
* Finish date: Wednesday, February 11, 2021
* Duration: 4
* Change
* User alters the start date to Tuesday, February 9, 2021 (start date in focus)
* Expected result
* Finish date is maintained, duration is automatically adjusted to 3 days (derived; logic = changing date affects duration)
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31053/content"></div></figure>
## Scenario 8
* Setup
* Start date: Tuesday, February 9, 2021
* Finish date: Friday, February 12, 2021
* Duration: 4
* Change
* User alters the finish date to Feb 11, 2021 (finish date is in focus).
* Expected result
* Start date is unaffected, duration is now set to 3 days (derived from dates).
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31064/content"></div></figure>
## Scenario 9
* Setup
* Start date: empty
* Finish date: empty
* Duration: 4
* Change
* User enters the finish date of Friday, February 12, 2021 (finish date in focus).
* Expected result
* The start date is set to Tuesday, February 9, 2021 (derived from duration).
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31055/content"></div></figure>
## Scenario 10
* Setup
* Start date: empty
* Finish date: Thursday, February 11, 2021
* Duration: empty
* Change
* User enters the start date of Tuesday, February 09, 2021 (start date in focus).
* Expected result
* Duration is set to 3 (derived from start date)
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31056/content"></div></figure>
## Scenario 11a
* Setup
* Two work packages
* Task 1:
* Start date: Monday, 15 February, 2021
* End date: Wednesday, 17 February, 2021
* Duration: 3
* Task 2:
* Start date: empty
* End date: empty
* Duration: empty.
* Change
* Change relations such that Task 2 preceeds Task 1.
* Expected result
* Dates for Task 2 are derived from this "proceeds" relation.
* Start date: Friday, 12 February, 2021 (dates including and after the work package this one preceedes are blocked)
* Duration: 1 (automatic)
* End date: Friday, 12 February, 2021 (derived from duration)
* Warning: Reminder the start and end dates need to be before the dates of the work package this one is preceeding.
* **\[open\]** Invalid dates are disabled. _This is something that needs to be explored further, both in terms of development effort and the impact on usability and comprehension._
* **\[open\]** Possible challenge: what if the dates are limited by another work package that the user (who can modify the dates for the current work package) cannot see, because of permissions?
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31057/content"></div></figure>
## Scenario 11b (new, to be discussed)
* Setup
* Two work packages
* Task 1:
* Start date: Monday, 15 February, 2021
* End date: Wednesday, 17 February, 2021
* Duration: 3
* Task 2:
* Start date: Thursday, 11 Febuary, 2021
* End date: Monday, 17 February, 2021
* Duration: 5
* Change
* Change relations such that Task 2 preceeds Task 1.
* **\[open, to be discussed\]** Expected result
* Dates for Task 2 are changed, such that finish date is the first available date preceeding Task 1. Duration is conserved:
* Start date: Monday, 8 February, 2021 (derived from duration and finish date)
* Duration: 5
* End date: Friday, 12 February, 2021
* Warning: Reminder the start and end dates need to be before the dates of the work package this one is preceeding.
**\[note\]** Today, the behaviour today seems inconsistent.
For example, in this example, _Test a3_ begins after _Test a2_. When _Test a3_ is given a "preceeds" relationship at _a2_, dates don't automatically adjust:
<figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31006/content"></div></figure>
If we flip the relationship, (give Test _a2_ a "preceeds" relationship to _Test a3),_ the dates for Test a3 seem to adjust automatically so it follows a2:
<figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31007/content"></div></figure>
This second behaviour seems reasonable; a2 terminates on 22.10, so a3 automatically starts on 23.10. Do we want to preseve this? Or perhaps make the behaviour more consistent between the two cases?
## Scenario 12a
* Setup
* Two work packages
* Task 1:
* Start date: Monday, 8 February, 2021
* End date: Wednesday, 10 February, 2021
* Duration: 3
* Task 2:
* Start date: empty
* End date: empty
* Duration: empty
* Change
* Change relations such that Task 2 follows Task 1.
* Expected result
* Dates for Task 2 are derived from this "follows" relation.
* Start date: Thursday, 11 February, 2021
* Duration: 1 (automatic)
* End date: Thursday, 11 February, 2021 (derived from duration)
* Warning: Reminder the start and end dates need to be after the work package this one following.
* **\[open\]** Invalid dates are disabled. _This is something that needs to be explored further, both in terms of development effort and the impact on usability and comprehension._
* **\[open\]** Possible challenge: what if the dates are limited by another work package that the user (who can modify the dates for the current work package) cannot see, because of permissions?
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31058/content"></div></figure>
## Scenario 21b (new, to be discussed)
* Setup
* Two work packages
* Task 1:
* Start date: Monday, 15 February, 2021
* End date: Friday, 19 February, 2021
* Duration: 5
* Task 2:
* Start date: Tuesday, 16 Febuary, 2021
* End date: Thursday, 18 February, 2021
* Duration: 3
* Change
* Change relations such that Task 2 follows Task 1.
* **\[open, to be discussed\]** Expected result
* Dates for Task 2 are changed, such that finish date is the first available date following Task 1. Duration is conserved:
* Start date: Monday, 22 February, 2021
* Duration: 3
* End date: Wednesday, 14 February, 2021
* Warning: Reminder the start and end dates need to be after the dates of the work package this one is following.
**\[note\]** Today, the behaviour today seems inconsistent.
For example, in this example, _Test a3_ begins after _Test a2,_ but before its finish date. When _Test a2_ is given a "follows" relationship at _a3_, dates don't automatically adjust:
<figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31009/content"></div></figure>
If we flip the relationship, (give Test _a2_ a "follows" relationship to _Test a3),_ the dates for Test a3 seem to adjust automatically so it follows a2:
<figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31008/content"></div></figure>
This second behaviour seems reasonable; a2 terminates on 22.10, so a3 automatically follows on the next available day, 23.10. Do we want to this? Or perhaps make the behaviour more consistent between the two cases?
## Scenario 13
* Setup
* Two work packages
* Task 1:
* Start date: Monday, 8 February, 2021
* End date: Wednesday, 10 February, 2021
* Duration: 3
* Task 2:
* Start date: empty
* End date: empty
* Duration: empty.
* Change
* Change relations such that Task 2 is a child of Task 1.
* Expected result
* Since the parent does not have any date information, dates and duration for Task 1 are derived from the child (as shown below)
* The work package is automatically scheduled.
* Start date: Monday, 8 February, 2021
* End date: Wednesday, 10 February, 2021
* Duration: 10
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31060/content"></div></figure>
### Scenario 13: Additional cases to discuss
* **\[open\]** If the parent work package already has dates, and if they are within the range of the child:
* Current behaviour: the original dates of the parent are discarded and replaced by the start/end dates of the sum of all children.
* **\[open\]** If the parent work package already has dates, but either start or finish date (or both) are outside of the range of the child:
* Current behaviour: the original dates of the parent are discarded and replaced by the start/end dates of the sum of all children.
* Child work packages are not limited by the date range of the parent; instead, changes to the dates of the children can "stretch" or "compress" the start and finish dates of the parent.
* **\[open\]** Do we maintain current behaviour?
## Scenario 14
* Setup
* Start date: Monday, February 9, 2021
* Finish date: Wednesday, February 11, 2021
* Duration: 3
* Change
* The user moves the drag handle on the left border (start date) of the box representing the work package in Gantt chart and Team planner one day to the right (to Feb 10, 2021)
* Expected result
* The duration is reduced to 2. The start date is set to Feb 10, 2021. The finish date is left unchanged.
## Scenario 15
* Setup
* Start date: Tuesday, February 9, 2021
* Finish date: Thursday February 11, 2021
* Duration: 3
* Change
* The user moves the work package by dragging it to the right so start date is Friday, Feb 12, 2021.
* Expected result
* The duration is maintained. Start state is now Friday, Febuary 12 2021 (as set by drag), end date is set Tuesday, Friday, February 16 (derived based on duration).
## Scenario 16a
(Added in response to <mention class="mention" data-id="42086" data-type="user" data-text="@Wieland Lindenthal">@Wieland Lindenthal</mention>'s [comment on the Datepicker feature](https://community.openproject.org/projects/openproject/work_packages/41341#activity-5)).
* Setup
* Start date: Tuesday, February 9, 2021
* Finish date: Thursday, February 11, 2021
* Duration: 3
* Change
* The user moves the start day to Wednesday, **March 3**, 2021 \*\*(\*\*note that this is _after_ the original start date).
* Expected result
* Duration is maintained and the finish date is now moved to Friday, March 5, 2021.
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31061/content"></div></figure>
## Scenario 16b (new, to be discussed)
* Setup
* Start date: Tuesday, February 9, 2021
* Finish date: Thursday, February 11, 2021
* Duration: 3
* Change
* The user moves the start day to Wednesday, **February 3**, 2021 \*\*(\*\*note that this is _before_ the original start date).
* Expected result
* The start date is now Wednesday, February 3.
* **\[open\]** The finish date is conserved (Thursday, February 11, 2021).
* **\[open\]** The duration is updated to 7 days.
# Visuals
#### **The new date picker drop modal**
<figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31062/content"></div></figure>
Additional visuals for the date picker are in the related work package describing the date picker <mention class="mention" data-id="41341" data-type="work_package" data-text="#41341">#41341</mention>.
#### Duration column in a work package table view
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/29244/content"></div></figure>
#### The date picker drop modal in the work package table view (duration)
Note that the "duration" field is focused when opening the drop modal by clicking on a duration value.
<figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/29243/content"></div></figure>
#### The duration column can also be used to adjust the GANTT chart
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/29242/content"></div></figure>
# Seed Data
**Static queries in section "Default data":**
* Gantt chart: Add duration column after column finish date:
**Queries in section favorite views**
* Project plan (Query ID 1): Add duration column after column finish date
* Project plan (Query ID 14): Add duration column after column finish date
# Full screen view
* Currently the status selection is below the subject at the same position for all work package types.
* We also move the dates and the curation to this area (visuals tbd).
* For milestones there is no duration by definition.
# Out-of-Scope
* Consider weekends and holidays (for this ticket, will normally already have been dealt with by <mention class="mention" data-id="18416" data-type="work_package" data-text="#18416">#18416</mention>)
* Summing duration _(need clarification)_
* Grouping by durations _(need clarification)_
**I want** to calculate the work package start and end dates based on the duration
**so** that I only have to set the duration.
# **Acceptance criteria:**
The duration feature affects a range of views and modules:
### Work package attributes and date picker
* In the date picker modal there is a text field `duration`.
* When the user enters a duration, the dates are derived.
* The contrary is also true: when a user enters dates, the duration is derived.
* More precise scenarios for what is derived/calculated as a result of what input (in which order), are [presented below](https://community.openproject.org/#scenarios).
* The duration represents the amount of days between the start and the finish date (inclusive):
* Monday to Tuesday: 2 days
* Monday to Monday (same day): 1 day
* Duration is always in full days (never floating point values).
* Once configuring non-working days is implemented (<mention class="mention" data-id="18416" data-type="work_package" data-text="#18416">#18416</mention>), these non-working days are _skipped_ _over_ and do not count towards the total duration:
* Friday to Monday: 2 days _(Saturday and Sunday are skipped over)_
* The user is able to override configured non-working days per work package; this means non-working can be optionally included, in which case they are _not_ skipped and count towards the date and duration count. More details in the [feature describing the datepicker](https://community.openproject.org/work_packages/41341) (<mention class="mention" data-id="41341" data-type="work_package" data-text="#41341">#41341</mention>).
* In all cases, the duration is consistent with the start and the finish date. Updating dates will update duration, and updating duration will update dates.
* It will not possible, for example, to specify a duration of 8 days for a task that starts and finishes the same week.
* The duration as well as start and due dates can not be configured via the form configuration. They are always present at the same place within the work package show page and form.
* This will be updated with <mention class="mention" data-id="40539" data-type="work_package" data-text="#40539">#40539</mention>.
* New work packages have an empty (not set) default duration
* unless the user has enabled the setting to give new work packages the current day (today) as the start date. In this case, this setting is respected.
* Certain date/duration information is derived (third value when two fields are filled).
* Setting start _and_ end dates automatically sets duration.
* Setting only one of the dates does not automatically set duration (unable to derive).
* Setting only one of the dates plus the duration sets the other date (derived).
* It is possible to have _only one attribute_ (only start date, only finish date or only duration) or all three. It is not possible to have just two (since the third will be derived from the other two).
* Concretely, these are **possible**:
* Duration specified; no start date; no finish dates is possible.
* A start date specified; no finish date; no duration is possible.
* A finish date specified; no start date; no duration is possible
* But these are **not possible**:
* A start date specified; duration specified; no end date is _not possible_. (End date is derived)
* A finish date specified; duration specified; no start date is _not possible_. (Start date is derived)
* A duration specified, start date specified, no finish date is _not possible_. (End date is derived)
* A duration specified, finish date specified, no start date is _not possible_. (Start date is derived).
* Milestone-typed work packages don't have a duration field.
* Still displayed as a diamond in the GANTT. In the team planner = 1 day.
* Uses the "simple" date picker, with just one date field and no duration.
* **\[open\]** Should it "take" a day, when scheduling? Currently it does, but perhaps it's wrong?
* The user has to to be informed when:
* Dates are automatically derived from relations (notably from parents or children),
* The user is always given a way to view relations, via an information banner (see <mention class="mention" data-id="41341" data-type="work_package" data-text="#41341">#41341</mention>).
* these automatically derived dates can not be modified, _unless_ manual scheduling is enabled, and thus relations are ignored.
* Schedules can be updated by moving certain work packages, within these limits:
* The parent's start and finish dates are determined by those of children (it will always that the start date of the earlist child and the finish date of the latest one).
* A work package A that has a _preceeds_ relationship with another one B, is limited to start/finish dates earlier than those of B.
* A work package Y that has a _follows_ relationship with another one X, is limited to start/finish dates later than those of X.
* _**\[open, need to discuss\]** However, it is always possible to modify a schedule by modifying the start/finish dates of the an earlier work package in a series of relationships to update all the ones that follow._
* _Naturally, this is as long as the work package being moved is not moved before the dates of another package preceeding it._
* _In other words, moving a preeceding work package can move following packages, but the opposite is not possible._
### Work package table view
* In the work packages list there is a column "duration". When clicking on this, the date modal with the date picker is opened, with the focus on the duration field.
* Ideally
* Filtering by duration is possible
* Sorting by duration is possible
### GANTT chart
* For work packages without start/finish dates but _with_ duration, the width of a "strip" representing such a work package on hover on a GANTT view has a width that is relative to its total duration (on drag over GANTT).
* "Relative" because width depends on the zoom level of the GANTT chart.
* On click, end date is calculated based on the the start date selected.
* If the duration is very long one (finish date is outside of current view), the user will first have to click to commit, and then zoom out or scroll to view the finish date.
* If the user modifies a work package via the drag handles on the left/right edges of the strips the in Gantt chart, both the start/finish date as well as the duration are altered in lockstep, based on which side is dragged.
* If non-working are included for that work package (via the date-picker), they will need to be taken into account in the GANTT too (for example, the work package should span the weekend if the weekend is included).
### Team planner
* For work packages without start/finish dates but _with_ duration, the width of a card that is dragged onto the team planner (from the left-hand "Add Existing" panel, for example) is relative to the total duration of that work package.
* "Relative" because width depends on the zoom level/view of the team planner calendar.
* If the user modifies a work package via the drag handles on the left/right edges of the cards on the Team planner, both the start/finish date as well as the duration are altered in lockstep.
* ~~**\[open\]** The user is able to modify the view such that weekends are not displayed on the team planner.~~
* ~~Even when weekends are not displayed, they are nevertheless represented (although with much narrower column widths and without a header).~~
* ~~This is especially important because manual scheduling nevertheless allows users to include non-working days into the date and duration count.~~
# Open
* Visuals for the rework of the dates & duration to be a fixed (not configurable) part of the work package show page and form (<mention class="mention" data-id="40539" data-type="work_package" data-text="#40539">#40539</mention>)
* Inheritance of the duration between a work package and its children
* e.g. can a work package have a duration that is less than the duration of its child. Only with manually scheduled.
* Normally a parent cannot have its own date values set by the user (unless manually scheduled).
* How will the duration be reflected in the activity, assuming that duration should be part of the activity? Naively the attributes start/finish and duration would all be displayed individually which might not be ideal.
* The duration would also be an additional activity that is displayed, if the duration is altered.
# Scenarios
## Scenario 1:
* Setup.
* Start date: Monday, February 8, 2021
* Finish date: empty
* Duration: empty
* Change
* User enters a duration of 10 days (duration in focus)
* Expected result:
* The finish date is set Friday, February 19 2021 (derived)
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31047/content"></div></figure>
## Scenario 2
* Setup
* Start date: empty
* Finish date: empty
* Duration: empty
* Change
* User enters a duration of 10 days
* Expected result:
* No date is added
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31048/content"></div></figure>
## Scenario 3
* Setup
* Start date: empty
* Finish date: Friday, February 19, 2021
* Duration: empty
* Change
* User enters a duration of 10 days (duration in focus).
* Expected result:
* The start date is set to Monday, February 8, 2021 (derived)
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31049/content"></div></figure>
## Scenario 4
* Setup
* Start date: Monday, February 8, 2021
* Finish date: Friday, February 19, 2021
* Duration: 10
* Change
* User changes duration to 11 days (duration in focus).
* Expected result:
* The finish date is changed to Monday, February, 22 2021
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31050/content"></div></figure>
## Scenario 5
* Setup
* Start date: Monday, February 8, 2021
* Finish date: Monday, February 22, 2021
* Duration: 11
* Change
* User changes duration to 10 days (duration in focus)
* Expected result:
* The finish date is changed to Friday, February, 19, 2021
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31051/content"></div></figure>
## Scenario 6
* Setup
* Start date: Tuesday, February 9, 2021
* Finish date: Friday, February 12, 2021
* Change
* Remove duration.
* Expected result
* Finish date is also removed, start date is maintained as is.
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31052/content"></div></figure>
## Scenario 7
* Setup
* Start date: Monday, February 8, 2021
* Finish date: Wednesday, February 11, 2021
* Duration: 4
* Change
* User alters the start date to Tuesday, February 9, 2021 (start date in focus)
* Expected result
* Finish date is maintained, duration is automatically adjusted to 3 days (derived; logic = changing date affects duration)
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31053/content"></div></figure>
## Scenario 8
* Setup
* Start date: Tuesday, February 9, 2021
* Finish date: Friday, February 12, 2021
* Duration: 4
* Change
* User alters the finish date to Feb 11, 2021 (finish date is in focus).
* Expected result
* Start date is unaffected, duration is now set to 3 days (derived from dates).
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31064/content"></div></figure>
## Scenario 9
* Setup
* Start date: empty
* Finish date: empty
* Duration: 4
* Change
* User enters the finish date of Friday, February 12, 2021 (finish date in focus).
* Expected result
* The start date is set to Tuesday, February 9, 2021 (derived from duration).
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31055/content"></div></figure>
## Scenario 10
* Setup
* Start date: empty
* Finish date: Thursday, February 11, 2021
* Duration: empty
* Change
* User enters the start date of Tuesday, February 09, 2021 (start date in focus).
* Expected result
* Duration is set to 3 (derived from start date)
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31056/content"></div></figure>
## Scenario 11a
* Setup
* Two work packages
* Task 1:
* Start date: Monday, 15 February, 2021
* End date: Wednesday, 17 February, 2021
* Duration: 3
* Task 2:
* Start date: empty
* End date: empty
* Duration: empty.
* Change
* Change relations such that Task 2 preceeds Task 1.
* Expected result
* Dates for Task 2 are derived from this "proceeds" relation.
* Start date: Friday, 12 February, 2021 (dates including and after the work package this one preceedes are blocked)
* Duration: 1 (automatic)
* End date: Friday, 12 February, 2021 (derived from duration)
* Warning: Reminder the start and end dates need to be before the dates of the work package this one is preceeding.
* **\[open\]** Invalid dates are disabled. _This is something that needs to be explored further, both in terms of development effort and the impact on usability and comprehension._
* **\[open\]** Possible challenge: what if the dates are limited by another work package that the user (who can modify the dates for the current work package) cannot see, because of permissions?
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31057/content"></div></figure>
## Scenario 11b (new, to be discussed)
* Setup
* Two work packages
* Task 1:
* Start date: Monday, 15 February, 2021
* End date: Wednesday, 17 February, 2021
* Duration: 3
* Task 2:
* Start date: Thursday, 11 Febuary, 2021
* End date: Monday, 17 February, 2021
* Duration: 5
* Change
* Change relations such that Task 2 preceeds Task 1.
* **\[open, to be discussed\]** Expected result
* Dates for Task 2 are changed, such that finish date is the first available date preceeding Task 1. Duration is conserved:
* Start date: Monday, 8 February, 2021 (derived from duration and finish date)
* Duration: 5
* End date: Friday, 12 February, 2021
* Warning: Reminder the start and end dates need to be before the dates of the work package this one is preceeding.
**\[note\]** Today, the behaviour today seems inconsistent.
For example, in this example, _Test a3_ begins after _Test a2_. When _Test a3_ is given a "preceeds" relationship at _a2_, dates don't automatically adjust:
<figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31006/content"></div></figure>
If we flip the relationship, (give Test _a2_ a "preceeds" relationship to _Test a3),_ the dates for Test a3 seem to adjust automatically so it follows a2:
<figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31007/content"></div></figure>
This second behaviour seems reasonable; a2 terminates on 22.10, so a3 automatically starts on 23.10. Do we want to preseve this? Or perhaps make the behaviour more consistent between the two cases?
## Scenario 12a
* Setup
* Two work packages
* Task 1:
* Start date: Monday, 8 February, 2021
* End date: Wednesday, 10 February, 2021
* Duration: 3
* Task 2:
* Start date: empty
* End date: empty
* Duration: empty
* Change
* Change relations such that Task 2 follows Task 1.
* Expected result
* Dates for Task 2 are derived from this "follows" relation.
* Start date: Thursday, 11 February, 2021
* Duration: 1 (automatic)
* End date: Thursday, 11 February, 2021 (derived from duration)
* Warning: Reminder the start and end dates need to be after the work package this one following.
* **\[open\]** Invalid dates are disabled. _This is something that needs to be explored further, both in terms of development effort and the impact on usability and comprehension._
* **\[open\]** Possible challenge: what if the dates are limited by another work package that the user (who can modify the dates for the current work package) cannot see, because of permissions?
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31058/content"></div></figure>
## Scenario 21b (new, to be discussed)
* Setup
* Two work packages
* Task 1:
* Start date: Monday, 15 February, 2021
* End date: Friday, 19 February, 2021
* Duration: 5
* Task 2:
* Start date: Tuesday, 16 Febuary, 2021
* End date: Thursday, 18 February, 2021
* Duration: 3
* Change
* Change relations such that Task 2 follows Task 1.
* **\[open, to be discussed\]** Expected result
* Dates for Task 2 are changed, such that finish date is the first available date following Task 1. Duration is conserved:
* Start date: Monday, 22 February, 2021
* Duration: 3
* End date: Wednesday, 14 February, 2021
* Warning: Reminder the start and end dates need to be after the dates of the work package this one is following.
**\[note\]** Today, the behaviour today seems inconsistent.
For example, in this example, _Test a3_ begins after _Test a2,_ but before its finish date. When _Test a2_ is given a "follows" relationship at _a3_, dates don't automatically adjust:
<figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31009/content"></div></figure>
If we flip the relationship, (give Test _a2_ a "follows" relationship to _Test a3),_ the dates for Test a3 seem to adjust automatically so it follows a2:
<figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31008/content"></div></figure>
This second behaviour seems reasonable; a2 terminates on 22.10, so a3 automatically follows on the next available day, 23.10. Do we want to this? Or perhaps make the behaviour more consistent between the two cases?
## Scenario 13
* Setup
* Two work packages
* Task 1:
* Start date: Monday, 8 February, 2021
* End date: Wednesday, 10 February, 2021
* Duration: 3
* Task 2:
* Start date: empty
* End date: empty
* Duration: empty.
* Change
* Change relations such that Task 2 is a child of Task 1.
* Expected result
* Since the parent does not have any date information, dates and duration for Task 1 are derived from the child (as shown below)
* The work package is automatically scheduled.
* Start date: Monday, 8 February, 2021
* End date: Wednesday, 10 February, 2021
* Duration: 10
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31060/content"></div></figure>
### Scenario 13: Additional cases to discuss
* **\[open\]** If the parent work package already has dates, and if they are within the range of the child:
* Current behaviour: the original dates of the parent are discarded and replaced by the start/end dates of the sum of all children.
* **\[open\]** If the parent work package already has dates, but either start or finish date (or both) are outside of the range of the child:
* Current behaviour: the original dates of the parent are discarded and replaced by the start/end dates of the sum of all children.
* Child work packages are not limited by the date range of the parent; instead, changes to the dates of the children can "stretch" or "compress" the start and finish dates of the parent.
* **\[open\]** Do we maintain current behaviour?
## Scenario 14
* Setup
* Start date: Monday, February 9, 2021
* Finish date: Wednesday, February 11, 2021
* Duration: 3
* Change
* The user moves the drag handle on the left border (start date) of the box representing the work package in Gantt chart and Team planner one day to the right (to Feb 10, 2021)
* Expected result
* The duration is reduced to 2. The start date is set to Feb 10, 2021. The finish date is left unchanged.
## Scenario 15
* Setup
* Start date: Tuesday, February 9, 2021
* Finish date: Thursday February 11, 2021
* Duration: 3
* Change
* The user moves the work package by dragging it to the right so start date is Friday, Feb 12, 2021.
* Expected result
* The duration is maintained. Start state is now Friday, Febuary 12 2021 (as set by drag), end date is set Tuesday, Friday, February 16 (derived based on duration).
## Scenario 16a
(Added in response to <mention class="mention" data-id="42086" data-type="user" data-text="@Wieland Lindenthal">@Wieland Lindenthal</mention>'s [comment on the Datepicker feature](https://community.openproject.org/projects/openproject/work_packages/41341#activity-5)).
* Setup
* Start date: Tuesday, February 9, 2021
* Finish date: Thursday, February 11, 2021
* Duration: 3
* Change
* The user moves the start day to Wednesday, **March 3**, 2021 \*\*(\*\*note that this is _after_ the original start date).
* Expected result
* Duration is maintained and the finish date is now moved to Friday, March 5, 2021.
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31061/content"></div></figure>
## Scenario 16b (new, to be discussed)
* Setup
* Start date: Tuesday, February 9, 2021
* Finish date: Thursday, February 11, 2021
* Duration: 3
* Change
* The user moves the start day to Wednesday, **February 3**, 2021 \*\*(\*\*note that this is _before_ the original start date).
* Expected result
* The start date is now Wednesday, February 3.
* **\[open\]** The finish date is conserved (Thursday, February 11, 2021).
* **\[open\]** The duration is updated to 7 days.
# Visuals
#### **The new date picker drop modal**
<figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/31062/content"></div></figure>
Additional visuals for the date picker are in the related work package describing the date picker <mention class="mention" data-id="41341" data-type="work_package" data-text="#41341">#41341</mention>.
#### Duration column in a work package table view
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/29244/content"></div></figure>
#### The date picker drop modal in the work package table view (duration)
Note that the "duration" field is focused when opening the drop modal by clicking on a duration value.
<figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/29243/content"></div></figure>
#### The duration column can also be used to adjust the GANTT chart
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/29242/content"></div></figure>
# Seed Data
**Static queries in section "Default data":**
* Gantt chart: Add duration column after column finish date:
**Queries in section favorite views**
* Project plan (Query ID 1): Add duration column after column finish date
* Project plan (Query ID 14): Add duration column after column finish date
# Full screen view
* Currently the status selection is below the subject at the same position for all work package types.
* We also move the dates and the curation to this area (visuals tbd).
* For milestones there is no duration by definition.
# Out-of-Scope
* Consider weekends and holidays (for this ticket, will normally already have been dealt with by <mention class="mention" data-id="18416" data-type="work_package" data-text="#18416">#18416</mention>)
* Summing duration _(need clarification)_
* Grouping by durations _(need clarification)_