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 will be 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** will be updated for the following stage to describe** _**only**_ **additions and changes for 12.3.** (for 12.3).**
<figure class="image op-uc-figure"><div op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/34053/content"></div></figure> src="/api/v3/attachments/30297/content"></div></figure>
### **Acceptance criteria**
Clicking on a date field displays the date picker drop modal:
#### Overview
The date picker extends consists of these sections (see [Anatomy](https://community.openproject.org/#anatomy) below for design anatomy), each of which is described in more detail below:
* **An information/warning banner**
* **Scheduling option selection**
* **Start date, finish date and duration input**
* **The two-month mini-calendar**
* **Action bar (with the option to include non-working days)**
#### Default behaviour
When the date picker from 12.2 with these new features: is opened, a field is always in focus by default.
* A new When opened by clicking the "start date" field, the start date will be in focus by default.
* When opened by clicking the "finish date" field, the finish date will be in focus by default.
* When opened by clicking on the "duration" field, the duration will be in focus by default.
When the unified date field next is implemented, clicking on it:
* Will open the date picker with the start date in focus.
When all fields are cleared, and a date/day is clicked:
* That date will be considered a start date by default.
* However, if the user then clicks on a date prior to that initially selected date, that second date will now be considered the start date, and the initial one the finish date. dates.
#### Warning/Information Banner
We use this banner to inform or warn the user when there is information contextual information.
* There can be two types of banners:
* An **information banner** has a blue background and is purely informational, to give the user additional context they might otherwise miss
* A **warning banner** has an orange background and indicates that changes to this work package may have destructive or unintended consequences (affect the dates/scheduling of other work packages)
* Non-working days taken into account (not included It consists of:
* an icon
* two-line message, the first in calculation bold
* a "GANTT preview" button that, when clicked, opens up a GANTT preview in a new window that allows the user to view relations affecting this work package.
* This is a filtered work package list (table view + GANTT view) showing only work packages related to the "main" work package (the one for which the GANTT preview was requested).
* _**Open:** We might have to show some kind of duration) when message to inform the user that certain work packages might be invisible (filtered out, or no permission)._
* There are five identified cases in which this banner is displayed:
* **Information:** The dates are automatically derived from relations (and date ranges include them. In other words, these days input is disabled in regular mode)
* **Warning:** Manual scheduling is enabled so all existing work package relations are skipped over. ignored.
* **Information:** Changing the dates of this work package will affect the total project duration.
* **Warning:** Changing the dates of this work package will change the dates of related work packages
* **Warning:** Available start and finish dates are limited by relations.
#### Regular/Manual Scheduling
* There are two modes
* **Regular** is the default scheduling mode where relations and project constraints are taken into account.
* **Manual** ignores work package relations and project constraints and functions as it does today when "manual scheduling" is checked.
* A checkbox to include non-working days helper icon in date ranges (and thus also duration) the label will display a tooltip with this text on hover :
* "Regular scheduling takes relations and project constraints into consideration, manual will ignore them."
#### Start Date, Finish Date and Duration
* There are a three fields that use the new "Duration" text field components:
* Start date
* Finish date
* Duration (new element)
* The user is able to input dates either:
* by clicking on the right of dates on the mini-calendar (in the date picker modal)
* by inputting the dates manually in the text fields for start date, finish date and duration in ISO format.
* Selecting a start date by clicking on a date or by inputting and pressing tab will move the focus to the finish date.
* On focus, the field is outlined in blue (focus style).
* The focus on the field also determines what is selected when the user clicks on a day in the calendar (i.e, clicking on the the start date field and then clicking on a date sets that date to the start date).
* The visual format for displaying dates depends on the locale settings.
* When in focus, the date text field should convert the date into an ISO format ("2022-03-31"). The user can then manually modify the date or enter a new date in this format.
* On blur (focus removed), the display goes back to a more readable format (depending on locale, eg. "Thu 31.03.2022")
* The visual format for displaying duration is "4 days".
* When in focus, this retains only the numerical value "4".
* 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 local unit for "days" is added again.
#### Mini The two-month mini-calendar
The mini calendar updates allows the user to select start and end dates:
* Two months are displayed (current and next month)
* Clicking on backwards/forwards advances the calendar by a single month (eg. clicking on "forward" displays displays on the first calendar the month that was previously in the second calendar).
* By default, non-working days are non-selectable (this includes weekends and custom non-working days)
* **\[open\]** Is the change applied on blur (focus out) or directly on input?
* Today, entering date will "select" it immediately. (But not duration yet).
* **\[to discuss, to see if we want this behaviour. Check with** **@Henriette Darge\]**
When the date fields are empty:
* Clicking on a date on the calendar will set it as the start date.
* Hovering on any date _**after**_ that initially selected date:
* will give a "preview" of the end date (as in, all dates between the selected start date and this second date will be highlighted on hover).
* Clicking on a date will then set that as the finish date.
* Hovering on any date _before_ that initially selected date:
* will also give a "preview" of the period selected, but in considering that first date as the finish date.
* Clicking on a date will then set that second date as start date, and the initially selected date as the finish date.
* The start and finish dates field have "clear" buttons on focus that allow the user to clear that date (current behaviour).
* **\[open\]** Or always show the clear button, even without focus?
* The start and finish dates are have rounded corners:
* **Start date** on the left edge.
* **Finish date** on the right edge.
* **A one-day event** will have rounded corners on all edges (when start date == end date).
* Each calendar day can has a few new states:
multiple states depending on what kind of day it is:
* **When enabled:**
* Regular day (black text on a neutral white background)
* Non-working day (_Gray#6_ text on a _Gray#3_ background)
* Start date and finish dates (white text on a _Main_ dark blue background)
* Selected but neither start/nor end (black text on a light blue _feedback/info/light_ background)
* In the selected range but a non-working day (blue _feedback/info/dark_ text on a _gray#6_ background)
* **When disabled:**
* Regular day (_gray#3_ text on a neutral white background)
* Non-working day (_gray#4_ text on a _gray#3_ background)
* Start date (_gray#3_ text on a _gray#5_ background)
* Selected but neither start/nor end (_gray#4_ text on a _gray#5_ background)
* In the selected range but a non-working day (_gray#5_ (_gray#6_ on a _gray#6_ _gray#4_ background)
<figure class="image op-uc-figure" style="width:75%;"><div style="width:50%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/34054/content"></div></figure> src="/api/v3/attachments/29238/content"></div><figcaption class="op-uc-figure--description">Date picker mini calendar when dates are enabled/clickable</figcaption></figure>
<figure class="image op-uc-figure" style="width:75%;"><div style="width:50%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/34055/content"></div></figure> src="/api/v3/attachments/29239/content"></div><figcaption class="op-uc-figure--description">Date picker mini calendar when dates are disabled/non-clickable</figcaption></figure>
#### "Include Action bar with "include non-working days" checkbox option
* The action bar has a new checkbox on the left edge: three actions:
* **Include non-working days checkbox:** checking checkbox**, which turns non-working days into regular days (and therefore including them even when finish date is derived using duration). duration)
* This removes the grey background on non-working days; all days now look the same as a "normal" day. **Cancel button** (outlined/main), discards changes
* Unchecking the box reverses this (and non-working days become grey again and are skipped in calculations).
* If a work package already has start and end dates (and thus also duration) and the user enables this checkbox, the dates remain unchanged and the duration is updated to include the additional days now included. (For example, it might for from 3 to 5 if the **Apply button** (filled/main), applies changes
### Anatomy
The date ranges previously spanned one weekend)
* If the user unchecks this box, the same will happen; start and end dates are preserved and duration picker is updated.
* If a work package only has one set built out of date information (just start date, just end date, or just duration), clicking this button will not affect any of thes evalues information until a second piece of information is also input.
* For example, for a work package with a start date only (so no duration), clicking this will immediately do nothing. However, if a second date is clicked, the duration calculated will now include non-working days.
* When migrating to 12.3, when the feature is introduced, all previous work packages will have this checkbox enabled (since non-working days will not have been taken into account several components already described in previously created work packages).
* For our design system, and some new work packages, this button will remain unchecked and non-working days will not be taken into account when calculating duration by default. ones.
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/30298/content"></div></figure>
### Visuals
**Regular scheduling, working days only (default):**
<figure class="image op-uc-figure"><div op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/34056/content"></div></figure> src="/api/v3/attachments/30299/content"></div></figure>
**Regular scheduling, include non-working days:**
<figure class="image op-uc-figure"><div op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/34057/content"></div></figure> src="/api/v3/attachments/30303/content"></div></figure>
**Automatic scheduling (mini calendar disabled):** **Manual scheduling, working days only:**
<figure class="image op-uc-figure"><div op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/34059/content"></div></figure> src="/api/v3/attachments/30304/content"></div></figure>
**Manual scheduling, working days only, with relations:** include non-working days:**
<figure class="image op-uc-figure"><div op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/34060/content"></div></figure> src="/api/v3/attachments/30302/content"></div></figure>
### Simple date picker
The simple date picker (for work packages **Automatically scheduled, modification blocked with only one date, like milesstones) still does not have a duration field, but now has the "Include non-working days" option: info banner**
_Info banner: Dates are derived from relations:_
**Simple date picker <figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/30305/content"></div></figure>
**Manual scheduling with the include non-working days option:** warning banner**
_Warning banner: relations are ignored:_
<figure class="image op-uc-figure"><div op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/34061/content"></div></figure> src="/api/v3/attachments/30306/content"></div></figure>
### Date-only date picker **Regular scheduling with info banner**
_Info banner: Changing dates will affect project duration:_
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:
<figure class="image op-uc-figure"><div op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/34065/content"></div></figure> src="/api/v3/attachments/30307/content"></div></figure>
### Mobile date picker
In the mobile version:
* the start/finish **Regular scheduling with warning banner**
_Warning banner: Changing dates continue to each take 50% will affect dates of the width and the duration field goes in a new line.
* the "include non-working days" goes in a new line before the action buttons. related packages (following or preceeding):_
<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> src="/api/v3/attachments/30309/content"></div></figure>
**Mobile simple date picker:** **Manual scheduling with warning banner**
_Warning banner: available start and finish dates are limited by relations (warning because dates might have changed)_
<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> src="/api/v3/attachments/30310/content"></div></figure>
**Mobile date-only ###
### Simple Date Picker
There will also be a "simple" date picker (used outside of with only a single _date_ field and a single calendar. A work packages):** package describing this will come shortly, but a preview exists:
<figure class="image op-uc-figure" style="width:75%;"><div style="width:50%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/34064/content"></div></figure> src="/api/v3/attachments/30311/content"></div></figure>
### Figma prototypes
Please keep All states of the date picker and mini calendar are illustrated in mind that the Figma page has a "(12.3) prototype, along with Duration" in the title (the 12.2 page looks very similar, so do double-check). When in doubt, follow this link: scenarios described [in the duration epic](https://community.openproject.org/projects/openproject/work_packages/31992/activity):
https://www.figma.com/file/SMzHAQWcY9k0PkTEKd5UQn/?node-id=1806%3A50629 [https://www.figma.com/file/SMzHAQWcY9k0PkTEKd5UQn/?node-id=1082%3A15447](https://www.figma.com/file/SMzHAQWcY9k0PkTEKd5UQn/?node-id=1082%3A15447)
**Please note that the date picker is being
**This ticket describes**
<figure class="image op-uc-figure"><div
### **Acceptance criteria**
#### Overview
* **An information/warning banner**
* **Scheduling option selection**
* **Start date, finish date and duration input**
* **The two-month mini-calendar**
* **Action bar (with
#### Default behaviour
When the
* A new
* When opened by clicking the "finish date" field, the finish date will be in focus by default.
* When opened by clicking on the
When the unified date
* Will open the date picker with the start date in focus.
When all fields are cleared, and a date/day is clicked:
* That date will be considered a start date by default.
* However, if the user then clicks on a date prior
#### Warning/Information Banner
We use this banner to inform or warn the user when there is information contextual information.
* There can be two types of banners:
* An **information banner** has a blue background and is purely informational, to give the user additional context they might otherwise miss
* A **warning banner** has an orange background and indicates that changes to this work package may have destructive or unintended consequences (affect the dates/scheduling of other work packages)
* Non-working days taken into account (not included
* an icon
* two-line message, the first
* a "GANTT preview" button that, when clicked, opens up a GANTT preview in a new window that allows the user to view relations affecting this work package.
* This is a filtered work package list (table view + GANTT view) showing only work packages related to the "main" work package (the one for which the GANTT preview was requested).
* _**Open:** We might have to show some kind
* There are five identified cases in which this banner is displayed:
* **Information:** The dates are automatically derived from relations (and
* **Warning:** Manual scheduling is enabled so all existing work package relations
* **Information:** Changing the dates of this work package will affect the total project duration.
* **Warning:** Changing the dates of this work package will change the dates of related work packages
* **Warning:** Available start and finish dates are limited by relations.
#### Regular/Manual Scheduling
* There are two modes
* **Regular** is the default scheduling mode where relations and project constraints are taken into account.
* **Manual** ignores work package relations and project constraints and functions as it does today when "manual scheduling" is checked.
* A checkbox to include non-working days
* "Regular scheduling takes relations and project constraints into consideration, manual will ignore them."
####
* There are a
* Start date
* Finish date
* Duration (new element)
* The user is able
* by clicking on
* by inputting the dates manually in the text fields for start date,
* Selecting a start date by clicking on a date or by inputting and pressing tab will move the focus to the finish date.
*
*
* The
* When in focus, the date text field should convert the date into an ISO format ("2022-03-31"). The user can then manually modify the date or enter a new date in this format.
* On blur (focus removed), the display goes back to a more readable format (depending on locale, eg. "Thu 31.03.2022")
* The visual format for displaying
* When in focus, this retains only the numerical value "4".
* 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
#### Mini
The mini
* Clicking on backwards/forwards advances the calendar by a single month (eg. clicking on "forward" displays displays on the first calendar the month that was previously in the second calendar).
* By default, non-working days are non-selectable (this includes weekends and custom non-working days)
* **\[open\]** Is the change applied on blur (focus out) or directly on input?
* Today, entering date will "select" it immediately. (But not duration yet).
* **\[to discuss, to see if we want this behaviour. Check with** **@Henriette Darge\]**
When the date fields are empty:
* Clicking on a date on the calendar will set it as the start date.
* Hovering on any date _**after**_ that initially selected date:
* will give a "preview" of the end date (as in, all dates between the selected start date and this second date will be highlighted on hover).
* Clicking on a date will then set that as the finish date.
* Hovering on any date _before_ that initially selected date:
* will also give a "preview" of the period selected, but in considering that first date as the finish date.
* Clicking on a date will then set that second date as start date, and the initially selected date as the finish date.
* The start and finish dates field have "clear" buttons on focus that allow the user to clear that date (current behaviour).
* **\[open\]** Or always show the clear button, even without focus?
* The start and finish dates are have rounded corners:
* **Start date** on the left edge.
* **Finish date** on the right edge.
* **A one-day event** will have rounded corners on all edges (when start date == end date).
*
* Non-working day (_Gray#6_ text on a _Gray#3_ background)
* Start date and finish dates (white text on a _Main_ dark blue background)
* Selected but neither start/nor end (black text on a light blue _feedback/info/light_ background)
*
* Non-working day (_gray#4_ text on a _gray#3_ background)
* Start date (_gray#3_ text on a _gray#5_ background)
* Selected but neither start/nor end (_gray#4_ text on a _gray#5_ background)
*
<figure class="image op-uc-figure" style="width:75%;"><div
<figure class="image op-uc-figure" style="width:75%;"><div
#### "Include
* The action bar has a new checkbox on the left edge:
* **Include non-working days checkbox:** checking
* This removes the grey background on non-working days; all days now look the same as a "normal" day.
* Unchecking the box reverses this (and non-working days become grey again and are skipped in calculations).
* If a work package already has start and end dates (and thus also duration) and the user enables this checkbox, the dates remain unchanged and the duration is updated to include the additional days now included. (For example, it might for from 3 to 5 if the
### Anatomy
The
* If the user unchecks this box, the same will happen; start and end dates are preserved and duration
* If a work package only has one set
* For example, for a work package with a start date only (so no duration), clicking this will immediately do nothing. However, if a second date is clicked, the duration calculated will now include non-working days.
* When migrating to 12.3, when the feature is introduced, all previous work packages will have this checkbox enabled (since non-working days will not have been taken into account
* For
**Regular scheduling, working days only (default):**
<figure class="image op-uc-figure"><div
**Regular scheduling, include non-working days:**
<figure class="image op-uc-figure"><div
**Automatic scheduling (mini calendar disabled):**
<figure class="image op-uc-figure"><div
**Manual scheduling, working days only, with relations:**
<figure class="image op-uc-figure"><div
### Simple date picker
The simple date picker (for work packages
_Info banner: Dates are derived from relations:_
**Simple date picker
**Manual scheduling
_Warning banner: relations are ignored:_
<figure class="image op-uc-figure"><div
### Date-only date picker
_Info banner: Changing dates will affect project duration:_
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:
<figure class="image op-uc-figure"><div
### Mobile date picker
In the mobile version:
* the start/finish
_Warning banner: Changing
* the "include non-working days" goes in a new line before the action buttons.
<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>
**Mobile simple date picker:**
_Warning banner: available start and finish dates are limited by relations (warning because dates might have changed)_
<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 date-only
### Simple Date Picker
There will also be a "simple" date
<figure class="image op-uc-figure" style="width:75%;"><div
### Figma prototypes
Please keep
https://www.figma.com/file/SMzHAQWcY9k0PkTEKd5UQn/?node-id=1806%3A50629