Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


UI Text Box
sizemedium
typeinfo

This function returns a text, similar to the function formatDuration(), but using the work day and work week defined at time tracking configuration, instead of 24 hours per day and 7 days a week. 


Code Block
languagebash
titleSyntax
linenumberstrue
formatWorkDuration(duration) #Output: Text


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
formatWorkDuration(5 * 8 * {HOUR} + 2 * 8 * {HOUR} + 3 * {HOUR})


This example returns : "1 week, 2 days, 3 hours"

UI Text Box
typeinfo

With 8 hours per workday and 5 days per workweek.

{HOUR} is a time macro.




UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
duration

Status
subtletrue
titlenumber

A number representing a duration or the calculation of a duration.



UI Expand
titleOutput

This function returns a

Status
subtletrue
titletext


UI Text Box
typetip

This function is extremely helpful when you want to automatically calculate the duration in JWT calculated text fields.

If you prefer a more comprehensive representation, have a look at the shortFormatWorkDuration() function.

FunctionOutput
shortFormatWorkDuration()"1d 11h 30m"
formatWorkDuration() "1 day, 11 hours, 30 minutes"




Image AddedUse cases and examples

Page properties report
firstcolumnUse case
headingsJWT feature, Workflow function, Field type, Automated action, Parser functions
cqllabel = "parser_func_formatworkduration" and space = currentSpace()


Page properties
hiddentrue



Status
Tech review

Status
colourGreen
titledone

Style guide

Status
colourGreen
titledone

Status
titletodo
Status
colourYellow
titleReady for review
Status
colourGreen
titledone
Status
colourRed
titleflagged



Page properties
hiddentrue


Short description

Returns a calculated duration using the workday and workweek defined at time tracking configuration.

Output

Status
subtletrue
titletext

Available since

Status
subtletrue
colourBlue
title2.2.34

Label