TimeUnit#
The unit that a task's duration and a link's lag are counted in. SchedulingConfig.durationUnit sets the project default. A task overrides it with TaskData.durationUnit, and a link with LinkData.lagUnit.
Declaration#
;
Values#
| Value | Description |
|---|---|
MINUTE |
Working minutes. Amounts are rounded to whole minutes when a date is placed. |
HOUR |
Working hours of 60 minutes. Amounts are rounded to whole minutes when a date is placed. |
DAY |
Working days. A working day of any length counts as one day, and a placed date keeps its time of day. Amounts are rounded to whole days when a date is placed. |
There are no week, month or year values.
A duration or lag in these units is working time: non-working time on the calendar doesn't count. TaskData.levelingDelay and Pause positions and lengths use the same unit as elapsed time, where DAY means 24 hours.
Where it's used#
| Member | Type | Meaning |
|---|---|---|
SchedulingConfig.durationUnit |
TimeUnit |
Project default. Default: DAY. |
TaskData.durationUnit |
TimeUnit |
Unit of the task's duration, levelingDelay and pauses. null uses the project default. |
LinkData.lagUnit |
TimeUnit |
Unit of the link's lag. null uses the project default. |
LinkAdd.lagUnit |
TimeUnit |
Same as LinkData.lagUnit, for a link added with apply. |
LinkUpdate.lagUnit |
Patch<TimeUnit> |
Changes the unit of an existing link's lag. |
In JSON the values are spelled "minute", "hour" and "day". Decode rejects any other spelling. See Exchange JSON with a client.
Example#
The project counts in days, task 2 counts in hours, and the link's lag is in minutes:
;
;
Output:
2: 2026-04-08 08:30 - 2026-04-08 15:30
Task 1 takes two working days, Monday and Tuesday. Task 2 starts 30 working minutes after that and runs six working hours on the default 08:00-12:00, 13:00-17:00 calendar.
Related#
TaskData- the duration unit of a taskLinkData- the lag unit of a linkSchedulingConfig.durationUnit- the project default- Durations and units - how units convert to working time