Content
View differences
Updated by Parimal Satyal almost 4 years ago
This sub-feature is part of the epic related to the duration feature (<mention class="mention" data-id="31992" data-type="work_package" data-text="#31992">#31992</mention>) and describes the functioning of the new date picker.
**Please note that the date picker is being implemented in multiple stages. The first version, for 12.2, is described here:** [**#42047**](https://community.openproject.org/work_packages/42047) **(date picker excluding duration and non-working days).**
**This ticket describes** _**only**_ **additions and changes for 12.3.**
<img class="op-uc-image op-uc-image_inline" style="width:460px;" src="/api/v3/attachments/37914/content"> src="/api/v3/attachments/37492/content">
### **Acceptance criteria**
The date picker extends the date picker from 12.2 with these new features:
* The "Manual scheduling" checkbox is now a toggle with title "Scheduling" andn two options:
* "Default"
* "Manual"
* There is a A new toggle set title "Working days" with two options
* "Work week"
* "Include weekends" "duration" field next to the finish date.
* By default, the toggles Non-working days taken into account (not included in calculation of duration) when date ranges include them. In other words, these days are set to "Default" (scheduling and "Work week" (Working days).
* Exceptions are described below. skipped over.
* A new "Duration" field next checkbox to the finish date. include non-working days in date ranges (and thus also duration)
#### Duration
* There are a new "Duration" field to the right of finish date
* The visual format for displaying duration is "4 days".
* When in focus, this retains only the numerical value "4".
* The field only accepts integers when in focus. On blur, it goes back to the normal display with the units ("n days", "n Tage", "n jours"...).
* ~~If the user types "4 days" (or "4 Tage", "4 jours"...), all information apart from the number is ignored. It should be considered the same as typing "4".~~
* On blur (remove focus), the localised word for "days" is added again.
_Added Added 16 August after discussion with <mention class="mention" data-id="39106" data-type="user" data-text="@Henriette Darge">@Henriette Darge</mention> and <mention class="mention" data-id="9177" data-type="user" data-text="@Oliver Günther">@Oliver Günther</mention>:_ Günther</mention>:
Normally, when clicking on individual dates in the mini calendar, the active field switches between the start date and the finish date, with each click. With the introduction of Duraiton, this behaviour is maintained, with these particularities:
* When the Duration field is clicked on (for manual input of duration), it is considered "active" (much like the start and finish date fields).
* Clicking outside of the duration field (blur) does not change the active field; it remains duration, and only changes:
* with a click on the start or finish date fields
* with a click on a date in the mini calendar
* when the modal is closed
* When a user modifies the duration integer:
* If no dates are entered, there is no impact on the mini-calendar.
* If both dates are present, the finish date is updated automatically based on the input (preserved, or shifted into the past or the future)
* If only a start date was present, a finish date is now derived.
* If only a finish date was present, a start date is now derived.
* When the user is in the duration field and clicks on a date in the mini calendar:
* If the duration field has a value, the clicked date becomes the the start date, the finish date is derived from the duration, and the active field moves to the finish date (same as when a date is clicked on when the start date is active).
* A click on a second date then modifies the finish date (and can affect duration).
* The active field shifts again back to the start date.
* If the duration field has no value, the clicked date becomes the start date, no finish date is set but the active field becomes the finish date.
* A click on a second date modifies the finish date (which derives duration too).
* The active field shifts again back to the start date.
#### Mini calendar updates
Each calendar day has a few new states:
* **When enabled:**
* In the selected range but a non-working day (blue _feedback/info/dark_ text on a _gray#6_ background)
* **When disabled:**
* In the selected range but a non-working day (_gray#5_ on a _gray#6_ background)
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37493/content"> <img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37494/content">
#### The "Working "Include non-working days" toggle set checkbox
* The action bar has a new toggle set: checkbox on the left edge:
* By default, "Work week" is selected and **Include non-working days, as defined in the admin settings, are not included in calculation of duration (when date ranges include them). In other words, these days are skipped over.
* Switching the toggle to "Include weekends" then overrides admin settings and includes checkbox:** checking turns non-working days in the calculation, and also makes these these into regular days clickable.
(and therefore including them even when finish date is derived using duration).
* This removes the grey background on non-working days; all days now look the same as a "normal" day.
* Switching Unchecking the toggle to "Work week" box reverses this and (and non-working days become grey again and are skipped in calculations.
* More advanced scenarios are described in the scenarios work package here: <mention class="mention" data-id="43539" data-type="work_package" data-text="#43539">#43539</mention>. calculations).
* If a work package already has start and end dates (and thus also duration) and the changes to "Include weekends", user enables this checkbox, the duration is preserved the dates are updated to include days that were previously skipped: skipped (the weekends, primarily).
* **Example:** A work package with a start date on a Thursday, and with a duration of 4 days, had a finish date of Tuesday (since Saturday and Sunday were skipped). Now Now, that weekend non-working days are included, the finish date is now Sunday, and the duration remains 4 days.
* If the user goes back to working days only (from previously including weekends) included non-working days), the duration is once again maintained, but the finish date is pushed to now skip over the non-working days.
* **Example:** In the same example as before, the work package now once again starts on a Thursday, finishes on a Tuesday and has a duration of 4 days.
* **Example 2:** In "include weekends" mode, a A user changes then the start date such that the work package now starts on a weekend (Saturday), normally non-working day (Saturday). The duration remains 4 days, with a finish date of Tuesday. Going back to "work week" Deactivating this option will now also push move the start date to Monday, with a finish date of Thursday (and (again, to maintain the duration of 4 days). duration).
* If a work package only has one set of date information (just start date, just end date, or just duration), changing clicking this toggle button will normally not affect any of the values until a second piece of information is also input (with one exception described below). exception).
* **For example,** for a work package with a start date only (so no duration), changing to the "Include weekends" mode clicking this will immediately do nothing. However, if a second date is clicked, the duration calculated will now include the admin-configured non-working days.
* **Exception:** When "Include weekends" mode enabled when the option is enabled, and the single one date (start _or_ finish) is on a defined normally non-working day (Saturday), then switching back to "Work week" disabling this option has to move that date to the first available working day (in the future). In future); in this case, it would be Monday.
* When migrating to 12.3, when the feature is introduced, all previous work packages will be toggled to "Include weekends" have this checkbox enabled (since non-working days will not have been taken into account in previously created work packages).
* For new work packages, by default, the toggle this button will be set to "Work week" remain unchecked and non-working days will not be taken into account when calculating duration by default.
* If the admin setting "User current date as start date for new work packages" is enabled, and a work package is created on a weekend, the start date will be set to the first available _working_ day (and not the weekend day).
* This is because the spirit of that admin setting is to simplify the creation of new work packages by not forcing the user to have to select a date every single time; this base default cannot make an assumption about the user's intention is in terms of including non-working days. (Creating a work package on a weekend does not necessarily mean that it will be scheduled to start the very day; automatically selecting this means we run the risk that the is not aware of the 'Include weekends' mode automatically changed on their behalf, which would affect scheduling even if they select a start date that is otherwise a working day).
* If the user _meant_ for the work package to start on a weekend _and_ have its duration span weekends, they can the toggle to explicitcly enable this mode.
#### Logical changes
* Changing either a date, the duration or the non-working days will have automatic effects on the other fields.The concrete logic is described in <mention class="mention" data-id="43539" data-type="work_package" data-text="#43539">#43539</mention>
* **Technical note:** Ideally this calculation is done by the backend, so that we don't have to repeat it in the frontend.
### Visuals
**Regular scheduling, working days only (default):**
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37915/content"> src="/api/v3/attachments/37495/content">
**Regular scheduling, include non-working days:**
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37917/content"> src="/api/v3/attachments/37496/content">
**Banner info - Automatic **Automatic scheduling (dates derived from children, mini (mini calendar disabled):**
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37918/content"> src="/api/v3/attachments/37497/content">
**Banner warning - Manual scheduling (with relations):**
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37920/content">
**Banner info - Dates limited by **Manual scheduling, working days only, with relations:**
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37927/content"> src="/api/v3/attachments/37498/content">
**Banner warning - Dates will affect related WPs:**
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37928/content">
### One-day Simple date picker
The one-day simple date picker (used for Milestones, for example) (for work packages with only one date, like milesstones) still does not have a duration field: field, but now has the "Include non-working days" option:
**One-day **Simple date picker:**
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37921/content">
**One-day date picker with a banner:** the include non-working days option:**
**<img <img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37922/content">** src="/api/v3/attachments/37499/content">
### Date-only date picker
Extracted, The date-only date picker is used in settings for example (outside of work packages). The option to include non-working days exists there too, to allow users to select one of those days:
**\[Work in progress, screens below will soon be specified in <mention class="mention" data-id="42358" data-type="work_package" data-text="#42358">#42358</mention>. updated\]**
### Mobile date picker
**\[Work in progress, screens below will soon be updated\]**
In the mobile version:
* The _Scheduling_ and _Working days_ toggle sets take a line each.
* the start/finish date fields dates continue to each take 50% of the width and the duration field goes in a new line.
* the duration field is moved to "include non-working days" goes in a new line before the action buttons.
**Mobile regular:** <figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/34062/content"></div></figure>
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37923/content">
**Mobile with banner warning (manual scheduling with relations):** simple date picker:**
**<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37925/content">** <figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/34063/content"></div></figure>
**Mobile one-day date date-only picker (Milestones):** (used outside of work packages):**
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37926/content"> <figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/34064/content"></div></figure>
### Figma prototypes
Please keep in mind that Figma page has a "(12.3) with Duration" in the title (the 12.2 page looks very similar, so do double-check). When in doubt, follow this link:
https://www.figma.com/file/SMzHAQWcY9k0PkTEKd5UQn/?node-id=1806%3A50629
**Please note that the date picker is being implemented in multiple stages. The first version, for 12.2, is described here:** [**#42047**](https://community.openproject.org/work_packages/42047) **(date picker excluding duration and non-working days).**
**This ticket describes** _**only**_ **additions and changes for 12.3.**
<img class="op-uc-image op-uc-image_inline" style="width:460px;" src="/api/v3/attachments/37914/content">
### **Acceptance criteria**
The date picker extends the date picker from 12.2 with these new features:
* The "Manual scheduling" checkbox is now a toggle with title "Scheduling" andn two options:
* "Default"
* "Manual"
* There is a
* "Work week"
* "Include weekends"
* By default, the toggles
* Exceptions are described below.
* A new "Duration" field next
#### Duration
* There are a new "Duration" field to the right of finish date
* The visual format for displaying duration is "4 days".
* When in focus, this retains only the numerical value "4".
* The field only accepts integers when in focus. On blur, it goes back to the normal display with the units ("n days", "n Tage", "n jours"...).
* ~~If the user types "4 days" (or "4 Tage", "4 jours"...), all information apart from the number is ignored. It should be considered the same as typing "4".~~
* On blur (remove focus), the localised word for "days" is added again.
_Added
Normally, when clicking on individual dates in the mini calendar, the active field switches between the start date and the finish date, with each click. With the introduction of Duraiton, this behaviour is maintained, with these particularities:
* When the Duration field is clicked on (for manual input of duration), it is considered "active" (much like the start and finish date fields).
* Clicking outside of the duration field (blur) does not change the active field; it remains duration, and only changes:
* with a click on the start or finish date fields
* with a click on a date in the mini calendar
* when the modal is closed
* When a user modifies the duration integer:
* If no dates are entered, there is no impact on the mini-calendar.
* If both dates are present, the finish date is updated automatically based on the input (preserved, or shifted into the past or the future)
* If only a start date was present, a finish date is now derived.
* If only a finish date was present, a start date is now derived.
* When the user is in the duration field and clicks on a date in the mini calendar:
* If the duration field has a value, the clicked date becomes the the start date, the finish date is derived from the duration, and the active field moves to the finish date (same as when a date is clicked on when the start date is active).
* A click on a second date then modifies the finish date (and can affect duration).
* The active field shifts again back to the start date.
* If the duration field has no value, the clicked date becomes the start date, no finish date is set but the active field becomes the finish date.
* A click on a second date modifies the finish date (which derives duration too).
* The active field shifts again back to the start date.
#### Mini calendar updates
Each calendar day has a few new states:
* **When enabled:**
* In the selected range but a non-working day (blue _feedback/info/dark_ text on a _gray#6_ background)
* **When disabled:**
* In the selected range but a non-working day (_gray#5_ on a _gray#6_ background)
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37493/content"> <img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37494/content">
#### The "Working
* The action bar has a new toggle set:
* By default, "Work week" is selected and
* Switching the toggle to "Include weekends" then overrides admin settings and includes
* More advanced scenarios are described in the scenarios work package here: <mention class="mention" data-id="43539" data-type="work_package" data-text="#43539">#43539</mention>.
* If a work package already has start and end dates (and thus also duration) and the changes to "Include weekends",
* **Example:** A work package with a start date on a Thursday, and with a duration of 4 days, had a finish date of Tuesday (since Saturday and Sunday were skipped). Now
* If the user goes back to working days only (from previously including weekends)
* **Example:** In the same example as before, the work package now once again starts on a Thursday, finishes on a Tuesday and has a duration of 4 days.
* **Example 2:** In "include weekends" mode, a
* If a work package only has one set of date information (just start date, just end date, or just duration), changing
* **For example,** for a work package with a start date only (so no duration), changing to the "Include weekends" mode
* **Exception:** When "Include weekends" mode enabled
* When migrating to 12.3, when the feature is introduced, all previous work packages will be toggled to "Include weekends"
* For new work packages, by default, the toggle
* If the admin setting "User current date as start date for new work packages" is enabled, and a work package is created on a weekend, the start date will be set to the first available _working_ day (and not the weekend day).
* This is because the spirit of that admin setting is to simplify the creation of new work packages by not forcing the user to have to select a date every single time; this base default cannot make an assumption about the user's intention is in terms of including non-working days. (Creating a work package on a weekend does not necessarily mean that it will be scheduled to start the very day; automatically selecting this means we run the risk that the is not aware of the 'Include weekends' mode automatically changed on their behalf, which would affect scheduling even if they select a start date that is otherwise a working day).
* If the user _meant_ for the work package to start on a weekend _and_ have its duration span weekends, they can the toggle to explicitcly enable this mode.
#### Logical changes
* Changing either a date, the duration or the non-working days will have automatic effects on the other fields.The concrete logic is described in <mention class="mention" data-id="43539" data-type="work_package" data-text="#43539">#43539</mention>
* **Technical note:** Ideally this calculation is done by the backend, so that we don't have to repeat it in the frontend.
### Visuals
**Regular scheduling, working days only (default):**
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37915/content">
**Regular scheduling, include non-working days:**
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37917/content">
**Banner info - Automatic
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37918/content">
**Banner warning - Manual scheduling (with relations):**
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37920/content">
**Banner info - Dates limited by
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37927/content">
**Banner warning - Dates will affect related WPs:**
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37928/content">
### One-day
The one-day
**One-day
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37921/content">
**One-day date picker with a banner:**
**<img
### Date-only date picker
Extracted,
**\[Work in progress, screens below
### Mobile date picker
* The _Scheduling_ and _Working days_ toggle sets take a line each.
* the start/finish date fields
* the duration field is moved to
**Mobile regular:**
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37923/content">
**Mobile with banner warning (manual scheduling with relations):**
**<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37925/content">**
**Mobile one-day date
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37926/content">
### Figma prototypes
Please keep in mind that Figma page has a "(12.3) with Duration" in the title (the 12.2 page looks very similar, so do double-check). When in doubt, follow this link:
https://www.figma.com/file/SMzHAQWcY9k0PkTEKd5UQn/?node-id=1806%3A50629