# Language Reference

## Comments

There are two ways to annotate a project file with comments. All text after a '#' will be ignored. Comments that span multiple rows must be started with '/*' and ended with '*/'.

## Attribute Classes

### DATE

A DATE is an ISO-compliant date in the format `YYYY-MM-DD[-hh:mm[:ss]][-TIMEZONE]`. Hour, minutes, seconds and the `TIMEZONE` are optional. If not specified, the values are set to 0. The local timezone or the default timezone is used if no other is specified. If the timezone is not known taskjuggler will fall back to UTC (GMT). The value of TIMEZONE can either be a timezone name or since this can be ambiguous, the offset to GMT as `+HHMM` or `-HHMM`. See the source code (`taskjuggler/Utility.cpp`) for details.

### DATEINTERVAL

A date interval consists of a start and end DATE. The end date is optional. If it is missing a 24 hour interval is assumed. The start and end date must be seperated by a dash character.

### GLOBAL_ID

A GLOBAL_ID may have the same characters as ID, but additionally may contain '.' and '!'. '!' may only be used at the beginning and is used in relative IDs. A '!' means one level up.

### ID

A string that may consist of the characters A-Z, a-z, 0-9, and _. It may not start with a number.

### INTEGER

A number that is an integer.

### LOGICALEXPRESSION

This is a logical expression consisting of logical operations, such as '&' for and, '|' for or, '˜' for not, '>' for greater than, '<' for less than, '=' for equal, '>=' for greater than or equal and '<=' for less than or equal to operate on INTEGER values or symbols. As symbols flag names and certain functions are supported. The expression is evaluated from left to right. '˜' has a higher precedence than other operators. Use braces to avoid ambiguous operations. If flagFoo, flagFooBar, and flagBar are declared flags, the following example is a correct expression:

    (flagFoo | flagFooBar) & ˜flagBar

The following functions can be used in logical expressions:

isChildOf(ID)

  true if the property has ID as sub.

isParentOf(ID)

  true if the property has ID as enclosing property.

isLeaf(ID)

  true if the property has no sub properties.

endsAfter(ID, DATE)

  true if the task ends in scenario ID after the specified date

endsBefore(ID, DATE)

  true if the task ends in scenario ID before the specified date

isAnAccount()

  true if the property is an account

isAccount(ID)

  true if the account has the listed ID

isAllocated(ID, DATE, DATE)

  true if the resource has been allocated in the specified time interval in the scenario with the specified ID.

isAllocatedToProject(PRJID SCENARIOID, DATE, DATE)

  true if the resource has been allocated to the specified project in the specified time interval in the scenario with the specified ID.

isMilestone()

  true if the task is a milestone.

isAResource()

  true if the property is a resource ID.

isResource(ID)

  true if the resource has the listed ID.

isATask()

  true if the property is a task.

isTask(ID)

  true if the task has the listed ID.

isTaskStatus(ID, STATUS)

  true if the task has in scenario ID the specified status. STATUS can be any of `notstarted`, `inprogresslate`, `inprogress`, `ontime`, `inprogressearly`, `late`, `finished`.

startsAfter(ID, DATE)

  true if the task starts in scenario ID after the specified date

startsBefore(ID, DATE)

  true if the task starts in scenario ID before the specified date

isTaskOfProject(ID)

  true if the task is part of the project with the specified ID.

isDutyOf(RESOURCE_ID, SCENARIO_ID)

  true if the resource with the specified ID is assigned to the task in the specified scenrio.

treeLevel()

  Nesting level of the property.

### REAL

A real number (e.g., 3.14).

### SORTINGCRITERIA

See attribute description for allowed values.

### STRING

A string may contain any characters and is enclosed in single quotes or double quotes. A single quoted string may contain double quote characters and vice versa. A string may include line breaks.

### TIME

A time in the format HH:MM.

### TIME

A time interval consists of a start and end TIME. The start and end time must be separated by a dash character.

### UNIT

May be `min` for minutes, `h` for hours, `d` for days, `w` for weeks, `m` for months, `y` for years. Week, month and year specifications are only approximated values and are handled slightly different for length, effort and duration intervals. For length and effort only working days are counted. The number or working days per week, month or year is determined by the setting of yearlyworkingdays. The number of working hours or minutes per working day is determined by the setting of dailyworkinghours.

### WEEKDAY

May be

- `mon`
- for Monday
- `tue`
- for Tuesday
- `wed`
- for Wednesday
- `thu`
- for Thursday
- `fri`
- for Friday
- `sat`
- for Saturday
- `sun`
- for Sunday

Optional attributes of a property must be enclosed by {}.