Skip weekends
This function adds or subtracts natural days (or working days) to or from any given date.
Weekends will not be counted as working days.
addDaysSkippingWeekends(timestamp, numberOfDays, timeZone) #Output: Number
Examples
|
Parser expression |
Description |
|---|---|
|
This example adds 2 working days to the issue's due date.
|
|
This example subtracts 2 working days from the issue's due date.
|
|
This example subtracts 6 working days from of a custom date-time field (with the ID 10100). Instead of the Jira server's local time, this example uses the current user's time zone. |
Additional information
Parameters used in this function
|
Parameter |
Input (data type) |
Description |
|---|---|---|
|
|
number |
The parameter must be valid timestamp. Usually this value is retrieved from a field (e.g. due date, created date). |
|
|
number |
The offset in days. Negative values are used to subtract days. Internally JWT multiplies this value with the time macro |
|
|
timezone |
The time zone used for the calculation. |
Work days might depend on the time zone - it might be Sunday on the west coast of the US while at the same time it's already Monday in Australia.
Output
This function returns a number representing a timestamp
Skip custom weekends
Variant of the function where you can additionally define the start and the end of the weekend.
This function is useful when the non-working days differ from the standard (Saturday/Sunday).
addDaysSkippingWeekends(timestamp, numberOfDays, timeZone, startOfWeekend, endOfWeekend) #Output: Number
Examples
|
Parser expression |
Description |
|---|---|
|
This example adds 10 working days to the issue's due date. Fridays and Saturdays are not counted and will be skipped.. |
|
This example subtracts 2 working days from the issue's due date. Sundays, Mondays and Tuesdays are not counted and will be skipped. |
Additional information
Parameters used in this function
|
Parameter |
Input (data type) |
Description |
|---|---|---|
|
|
number |
The parameter must be valid timestamp. Usually this value is retrieved from a field (e.g. due date, created date). |
|
|
number |
The offset in days. Negative values are used to subtract days. Internally JWT multiplies this value with the time macro |
|
|
timezone |
The time zone used for the calculation. |
|
|
number |
Valid values are |
|
|
number |
Valid values are |
Work days might depend on the time zone - it might be Sunday on the west coast of the US while at the same time it's already Monday in Australia.
Output
This function returns a number representing a timestamp
The output can be written into any Jira field of type Date Picker ore Date Time Picker.
Another very common use case is to use this function in one of the JWT calculated date-time fields.
If you want to subtract two date-time values you might want to have a look at the function subtractDatesSkippingWeekends().
(books) Use cases and examples
| Use case |
|---|
| No content found. |