You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: data/api/gantt_calendar_other.md
+64-12Lines changed: 64 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,36 +30,79 @@ The **calendar** object possesses the following methods and properties:
30
30
- **_to_** - (*Date*) - the date when the time span is scheduled to be completed
31
31
- **_hours?_** - (*string[] | number[]*) - optional, an array of working hours as 'from'-'to' pairs.'false' value sets a day-off, 'true' (default value) applies the default hours (["8:00-17:00"])
32
32
- **_days?_** - (*WorkDaysTuple | boolean*) - optional, an array of 7 days of the week (from 0 - Sunday, to 6 - Saturday), where 1/true stands for a working day and 0/false - a non-working day.
- <spanclass=submethod>**isWorkTime (config, time_unit): boolean**</span> - checks whether the specified date is working
52
91
-**_config_** - (*Date | object*) - either a date to check or the [configuration object](api/gantt_isworktime.md#configurationobjectproperties) of a time span:
53
92
- **_date_** - (*Date*) - a date to check
54
93
- **_unit?_** - (*string*) - optional, a time unit: "minute", "hour", "day", "week", "month", "year"
55
94
- **_task?_** - (*Task*) - optional, the object of the task the duration of which should be calculated
56
-
-**_time_unit?_** - (*string*) - optional, a time unit: "minute", "hour", "day", "week", "month", "year". Not needed at all when the first parameter is specified as an object<br><br>
95
+
-**_time_unit?_** - (*string*) - optional, a time unit: "minute", "hour", "day", "week", "month", "year". Not needed at all when the first parameter is specified as an object
- <spanclass=submethod>**getClosestWorkTime (config): Date**</span> - returns the closest working time
@@ -70,14 +113,15 @@ if (calendar.isWorkTime({date: date})){
70
113
- **_task?_** - (*Task*) - optional, the object of the task to use its calendar
71
114
72
115
~~~js
73
-
calendar.getClosestWorkTime({
74
-
date:newDate(2013,0,1),
75
-
dir:"future",
76
-
unit:"hour"
116
+
calendar.getClosestWorkTime(newDate(2025, 5, 6));
117
+
calendar.getClosestWorkTime({
118
+
date:newDate(2025, 5, 6),
119
+
unit:"hour",
120
+
task:gantt.getTask(2),
121
+
dir:"past"
77
122
});
78
123
~~~
79
124
80
-
81
125
- <spanclass=submethod>**calculateEndDate (config, duration, unit): Date**</span> - calculates the end date of a task
82
126
-**_config_** - (*Date | object*) - either the date when a task is scheduled to begin or the [configuration object](api/gantt_calculateenddate.md#configurationobjectproperties) of a time span:
83
127
- **_start_date_** - (*Date*) - the date when a task is scheduled to begin
@@ -88,7 +132,12 @@ calendar.getClosestWorkTime({
88
132
-**_unit?_** - (*string*) - optional, the time unit of the duration. Not needed at all when the first parameter is specified as an object<br>
89
133
90
134
~~~js
91
-
var end_date =calendar.calculateEndDate({start_date:date, duration:duration});
<td> an array of working hours as 'from'-'to' pairs. <br><i>'false'</i> value sets a day-off, <i>'true' (default value)</i> applies the default hours (["8:00-17:00"])</td>
76
+
<td> an array of working hours as 'from'-'to' pairs. <br><i>'false'</i> value unsets working hours,
77
+
<i>'true' (default value)</i> applies the default hours: (["8:00-17:00"])</td>
0 commit comments