Warning |
---|
Looking for the documentation on the newest versions of SIL Engine and the Simple Issue Language for Jira 8 for Server/Data Center? Click here ! |
Info | ||
---|---|---|
| ||
This routine is available starting with katl-commons SIL Engine™ 2.5. |
Syntax
toRawWorkingInterval (interval, [workingHours/day]);
...
This routine re-writes a 24h day interval in an interval that is based on 8h (for instance). It is raw, in the sense that it does NOT care not sensitive for weekends, holidays, leave without pay etc, and so on.
The result interval is converted using the workingHours/day parameter that is optional and is an integer between 1 and 24. This routine can be used to view how much hours can a user work during a week (, for instance).
Parameters
Parameter name | Type | Required | Description |
---|---|---|---|
interval | interval | Yes | Specifies a date interval that will be converted from 24 hours/day to working hours/day. |
format | number | No | Specifies the number of working hours per day the interval will be converted to. The default number is 8, if another number isn't specified. |
...
Code Block |
---|
date begin = "2013-01-17T12:30:00"; date end = "2013-01-28T16:30:00"; return toRawWorkingInterval(end - begin, 6); |
This will return : "2d 22h" becausedue to:
...
- The interval between begin date and end date is 11d 4h.
...
- If we convert a day from 24 hours to a 6 hour per day we will make the following computation:
...
...
- 11d * 6h + 4h = 66h + 4h = 70h that will be viewed as 2d 22h.
Example 2
By running this code:
Code Block |
---|
date begin = "2013-01-17T02:30:00"; date end = "2013-01-28T16:30:00"; return toRawWorkingInterval(end - begin); |
The result of it will be: return "4d" becausedue to:
...
- The interval is "11d 12h" long.
...
- The conversion is based on this computation:
...
- 12d * 8h(default hours) = 96h that means "4d".
...
- This is done so because the number of hours in the 12th day of the interval exceeds the number of working hours per day (by default 8) and a new day is added.
...
See also
Filter by label (Content by label) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|