This function returns a number representing the week of the year of a given date in a certain time zone.
weekOfTheYear(timestamp, firstDayOfTheWeek, minimalDaysInFirstWeek, timeZone) #Output: Number
Examples
|
Parser expression |
Description |
|---|---|
|
Bash
|
This example returns: 1 |
|
Bash
|
This example returns: 2 |
|
Bash
|
This example might return 20 if the issue was created in week 20. |
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 first day of the week, e.g.: |
|
|
number |
The minimal number of days required in the first week of the year, e.g., if the first week is defined as the one that contains the first day of the first month of the year, value 1 should be used. If the minimal number of days required must be a full week (e.g. all days of the week need to be in that year), value 7 should be used. |
|
|
timezone |
The time zone used for the calculation. |
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
📚 Use cases and examples
| Use case | Workflow function | Parser functions |
|---|---|---|
| Set a date on the same week day on alternate weeks |
addDays() nextDayOfTheWeek() modulus() weekOfTheYear() datePart() |