Calendar
This function subtracts two timestamps using a JWT calendar. The time time difference will be returned in milliseconds.
timeDifference(firstDate, dateToSubtract, calendarName, timeZone) #Output: Number
Examples
Assumption: A custom JWT calendar called "my_calendar" has been defined as follows:
MON - THU {
08:00 - 15:00,
16:00 - 19:30;
}
FRI {
08:00 - 15:00;
}
|
Parser expression |
Description |
|---|---|
|
Bash
|
This example calculates the elapsed time from issue creation to the current date and time using the calendar my-calendar. The result will return milliseconds. |
|
Bash
|
This example calculates the elapsed time from issue creation to the current date and time using the calendar my-calendar. The result will return hours. |
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 parameter must be valid timestamp. Usually this value is retrieved from a field (e.g. due date, created date). |
|
|
text |
The name of the used JWT calendar. |
|
|
timezone |
The time zone used for the conversion. |
Output
The function returns a number .
Calendar with additional specifier
Variant of the function where you can define an additional JWT calendar specification.
timeDifference(firstDate, dateToSubtract, calendarName, additionalSpecifier, timeZone) #Output: Number
Examples
|
Parser expression |
Description |
|---|---|
|
Bash
|
This example calculates the elapsed time from issue creation to the current date and time using the calendar my-calendar and additionally ignoring the 20th of May, 2020. The result will return milliseconds. |
|
Bash
|
This example calculates the elapsed time from issue creation to the current date and time using the calendar my-calendar and additionally ignoring the 20th of May, 2020. The result will return hours. |
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 parameter must be valid timestamp. Usually this value is retrieved from a field (e.g. due date, created date). |
|
|
text |
The name of the used JWT calendar. |
|
|
text |
A text containing an additional JWT calendar specification. |
|
|
timezone |
The time zone used for the calculation. |
Output
The function returns a number
📚 Use cases and examples
| Use case | Workflow function | Field type | Parser functions |
|---|---|---|---|
| Difference between two dates in business days | |||
| Automatically log work spent in a specific status |