Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ npm run lint # eslint over src/ (flat config, intentionally lax)
- The build must stay green: run `npm run build` after any `src/` change, and `npm run lint` should pass.
- Sample pages reference `../../codebase/dhtmlxgantt.js` — run a build before opening them.
- `src/types.d.ts` declares the compile-time globals (`VERSION`, `LICENSE`, …) injected by vite `define`.
- Some modules are intentional basic implementations of Pro features (e.g. `src/core/ui/render/dummy_layer.js`, re-export shims like `src/core/ui/grid/resource_grid.js`, and `src/core/worktime/strategy/calendar_strategy.js` which re-exports the disabled `no_work_time` strategy — working-time calendars are out of scope). Do not "complete" them — the Pro feature set is out of scope for this edition (see Scope below).
- Some modules are intentional basic implementations of Pro features (e.g. `src/core/ui/render/dummy_layer.js`, re-export shims like `src/core/ui/grid/resource_grid.js`, and `src/core/worktime/strategy/no_work_time.ts`, the disabled (all-time-is-working) strategy that the calendar manager uses for every calendar — working-time calendars are out of scope). Do not "complete" them — the Pro feature set is out of scope for this edition (see Scope below).

### Conventions

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHTMLX Gantt - JavaScript Gantt Chart (Community Edition)

[![npm: v.10.0.4](https://img.shields.io/badge/npm-v.10.0.4-blue.svg)](https://www.npmjs.com/package/dhtmlx-gantt) · [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.md) · [![made by DHTMLX](https://img.shields.io/badge/made%20by-DHTMLX-blue)](https://dhtmlx.com/)
[![npm: v.10.1.0](https://img.shields.io/badge/npm-v.10.1.0-blue.svg)](https://www.npmjs.com/package/dhtmlx-gantt) · [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.md) · [![made by DHTMLX](https://img.shields.io/badge/made%20by-DHTMLX-blue)](https://dhtmlx.com/)

![](dhtmlx_logo.svg)

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gantt",
"version": "10.0.4",
"version": "10.1.0",
"homepage": "https://dhtmlx.com/docs/products/dhtmlxGantt/",
"description": "An open source JavaScript Gantt chart that helps you illustrate a project schedule in a nice-looking chart.",
"main": [
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dhtmlx-gantt",
"version": "10.0.4",
"version": "10.1.0",
"description": "DHTMLX Gantt - open source JavaScript Gantt chart (Community edition)",
"type": "module",
"main": "codebase/dhtmlxgantt.js",
Expand Down
22 changes: 11 additions & 11 deletions samples/01_initialization/01_basic_init.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@
tasks: [
{ id: 11, text: "Project #1", type: "project", progress: 0.6, open: true },

{ id: 12, text: "Task #1", start_date: "03-04-2023", duration: 5, parent: 11, progress: 1, open: true },
{ id: 13, text: "Task #2", start_date: "03-04-2023", type: "project", parent: 11, progress: 0.5, open: true },
{ id: 14, text: "Task #3", start_date: "02-04-2023", duration: 6, parent: 11, progress: 0.8, open: true },
{ id: 12, text: "Task #1", start_date: "05-04-2027", duration: 5, parent: 11, progress: 1, open: true },
{ id: 13, text: "Task #2", start_date: "05-04-2027", type: "project", parent: 11, progress: 0.5, open: true },
{ id: 14, text: "Task #3", start_date: "04-04-2027", duration: 6, parent: 11, progress: 0.8, open: true },
{ id: 15, text: "Task #4", type: "project", parent: 11, progress: 0.2, open: true },
{ id: 16, text: "Final milestone", start_date: "15-04-2023", type: "milestone", parent: 11, progress: 0, open: true },
{ id: 16, text: "Final milestone", start_date: "17-04-2027", type: "milestone", parent: 11, progress: 0, open: true },

{ id: 17, text: "Task #2.1", start_date: "03-04-2023", duration: 2, parent: 13, progress: 1, open: true },
{ id: 18, text: "Task #2.2", start_date: "06-04-2023", duration: 3, parent: 13, progress: 0.8, open: true },
{ id: 19, text: "Task #2.3", start_date: "10-04-2023", duration: 4, parent: 13, progress: 0.2, open: true },
{ id: 20, text: "Task #2.4", start_date: "10-04-2023", duration: 4, parent: 13, progress: 0, open: true },
{ id: 21, text: "Task #4.1", start_date: "03-04-2023", duration: 4, parent: 15, progress: 0.5, open: true },
{ id: 22, text: "Task #4.2", start_date: "03-04-2023", duration: 4, parent: 15, progress: 0.1, open: true },
{ id: 23, text: "Intermediate milestone", start_date: "14-04-2023", type: "milestone", parent: 15, progress: 0, open: true }
{ id: 17, text: "Task #2.1", start_date: "05-04-2027", duration: 2, parent: 13, progress: 1, open: true },
{ id: 18, text: "Task #2.2", start_date: "08-04-2027", duration: 3, parent: 13, progress: 0.8, open: true },
{ id: 19, text: "Task #2.3", start_date: "12-04-2027", duration: 4, parent: 13, progress: 0.2, open: true },
{ id: 20, text: "Task #2.4", start_date: "12-04-2027", duration: 4, parent: 13, progress: 0, open: true },
{ id: 21, text: "Task #4.1", start_date: "05-04-2027", duration: 4, parent: 15, progress: 0.5, open: true },
{ id: 22, text: "Task #4.2", start_date: "05-04-2027", duration: 4, parent: 15, progress: 0.1, open: true },
{ id: 23, text: "Intermediate milestone", start_date: "16-04-2027", type: "milestone", parent: 15, progress: 0, open: true }
],
links: [
{ id: 10, source: 11, target: 12, type: 1 },
Expand Down
2 changes: 1 addition & 1 deletion samples/01_initialization/02_load_json.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@

gantt.config.date_format = "%Y-%m-%d %H:%i:%s";
gantt.init("gantt_here");
gantt.load("../common/data.json", "json");
gantt.load("../common/data_public.json", "json");
</script>
</body>
2 changes: 1 addition & 1 deletion samples/01_initialization/07_jquery.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script src="../../codebase/dhtmlxgantt.js"></script>
<link rel="stylesheet" href="../../codebase/dhtmlxgantt.css">

<script src="../common/testdata.js"></script>
<script src="../common/testdata_public.js"></script>
<style>
html, body {
height: 100%;
Expand Down
63 changes: 32 additions & 31 deletions samples/01_initialization/08_explicit_time_range.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
<title>Define displayed date range</title>
<script src="../../codebase/dhtmlxgantt.js"></script>
<link rel="stylesheet" href="../../codebase/dhtmlxgantt.css">
<link rel="stylesheet" href="../common/controls_styles.css">
<link rel="stylesheet" href="../common/sample_toolbar.css">

<script src="../common/testdata.js"></script>
<script src="../common/testdata_public.js"></script>
<script src="../common/sample_toolbar.js"></script>
<style>
html, body {
height: 100%;
Expand All @@ -17,50 +18,50 @@
#gantt_here {
width: 100%;
height: 800px;
height: calc(100vh - 52px);
height: 100%;
}

.gantt_control{
background-color: #e5e0cd;
}

</style>
</head>
<body>

<div class="gantt_control">
<label>Displayed date range:</label>
<input class="start_date" type="date" value="2026-08-01" onchange="changeDates()">
&ndash;
<input class="end_date" type="date" value="2026-08-20" onchange="changeDates()">
</div>
<div id="gantt_here"></div>
<script>
function changeDates() {
const startDateEl = document.querySelector(".start_date");
const endDateEl = document.querySelector(".end_date");
const startDate = new Date(startDateEl.value);
const endDate = new Date(endDateEl.value);

if (!+startDate || !+endDate) {
return;
}

gantt.config.start_date = startDate;
gantt.config.end_date = endDate;
gantt.render();
}

gantt.plugins({ toolbar: true });
gantt.setSkin("meadow");
gantt.config.scales = [
{unit: "month", step: 1, format: "%M"},
{unit: "year", step: 1, format: "%Y"},
{unit: "day", format: "%d %M"}
];
gantt.config.scale_height = 3 * 28;
gantt.config.start_date = new Date(2026, 7, 1);
gantt.config.end_date = new Date(2026, 8, 20);

gantt.config.start_date = new Date(2027, 6, 31);
gantt.config.end_date = new Date(2027, 8, 19);
const range = {
start: new Date(2027, 6, 31),
end: new Date(2027, 7, 19)
};
gantt.config.toolbar = [
{ comp: "label", label: "Displayed date range:" },
{
id: "start", comp: "datepicker", width: 132, ariaLabel: "Start date", value: range.start,
config: { format: "%Y-%m-%d", placeholder: "Start date" }
},
{
id: "end", comp: "datepicker", width: 132, ariaLabel: "End date", value: range.end,
config: { format: "%Y-%m-%d", placeholder: "End date" }
}
];
gantt.attachEvent("onToolbarItemChange", function(id, value) {
range[id] = value;
if (!range.start || !range.end || !(range.end > range.start)) {
return;
}
gantt.config.start_date = new Date(range.start);
gantt.config.end_date = new Date(range.end);
gantt.render();
});
gantt.config.layout = withSampleToolbar(gantt.config.layout);
gantt.init("gantt_here");
gantt.parse(demo_tasks);
</script>
Expand Down
2 changes: 1 addition & 1 deletion samples/01_initialization/10_fixed_size.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<script src="../../codebase/dhtmlxgantt.js"></script>
<link rel="stylesheet" href="../../codebase/dhtmlxgantt.css">

<script src="../common/testdata.js"></script>
<script src="../common/testdata_public.js"></script>
</head>
<body>
<div id="gantt_here" style='width:1020px; height:400px;'></div>
Expand Down
2 changes: 1 addition & 1 deletion samples/01_initialization/11_clickable_links.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<script src="../../codebase/dhtmlxgantt.js"></script>
<link rel="stylesheet" href="../../codebase/dhtmlxgantt.css">

<script src="../common/testdata.js"></script>
<script src="../common/testdata_public.js"></script>
<style>
html, body {
height: 100%;
Expand Down
127 changes: 66 additions & 61 deletions samples/01_initialization/12_localization.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
<title>Localization</title>
<script src="../../codebase/dhtmlxgantt.js"></script>
<link rel="stylesheet" href="../../codebase/dhtmlxgantt.css">
<link rel="stylesheet" href="../common/controls_styles.css">
<link rel="stylesheet" href="../common/sample_toolbar.css">

<script src="../common/testdata.js"></script>
<script src="../common/testdata_public.js"></script>
<script src="../common/sample_toolbar.js"></script>
<style>
html, body {
height: 100%;
Expand All @@ -17,78 +18,82 @@
#gantt_here {
width: 100%;
height: 800px;
height: calc(100vh - 52px);
height: 100%;
}

</style>
</head>

<body>
<div class="gantt_control">
<label>Current locale:</label>
<select class="locale_changer" onchange="changeLocale(this.value)">
<option class="locale_" value="">Choose locale</option>
<option class="locale_af" value="af">Afrikaans</option>
<option class="locale_sq" value="sq">Albanian</option>
<option class="locale_ar" value="ar">Arabic</option>
<option class="locale_be" value="be">Belarusian</option>
<option class="locale_bs" value="bs">Bosnian</option>
<option class="locale_bg" value="bg">Bulgarian</option>
<option class="locale_ca" value="ca">Catalan</option>
<option class="locale_cn" value="cn">Chinese (Simplified)</option>
<option class="locale_zh_hk" value="zh_hk">Chinese (Hong Kong)</option>
<option class="locale_zh_tw" value="zh_tw">Chinese (Taiwan)</option>
<option class="locale_hr" value="hr">Croatian</option>
<option class="locale_cs" value="cs">Czech</option>
<option class="locale_da" value="da">Danish</option>
<option class="locale_nl" value="nl">Dutch</option>
<option class="locale_nl_be" value="nl_be">Dutch (Belgium)</option>
<option class="locale_" value="">English</option>
<option class="locale_et" value="et">Estonian</option>
<option class="locale_fi" value="fi">Finnish</option>
<option class="locale_fr" value="fr" selected>French (France)</option>
<option class="locale_fr_ca" value="fr_ca">French (Canada)</option>
<option class="locale_de" value="de">German (Germany)</option>
<option class="locale_de_at" value="de_at">German (Austria)</option>
<option class="locale_el" value="el">Greek</option>
<option class="locale_he" value="he">Hebrew</option>
<option class="locale_hu" value="hu">Hungarian</option>
<option class="locale_id" value="id">Indonesian</option>
<option class="locale_ga" value="ga">Irish</option>
<option class="locale_it" value="it">Italian</option>
<option class="locale_jp" value="jp">Japanese</option>
<option class="locale_kr" value="kr">Korean</option>
<option class="locale_lv" value="lv">Latvian</option>
<option class="locale_lt" value="lt">Lithuanian</option>
<option class="locale_mk" value="mk">Macedonian</option>
<option class="locale_ms" value="ms">Malay</option>
<option class="locale_nb" value="nb">Norwegian (Bokmål)</option>
<option class="locale_no" value="no">Norwegian (Nynorsk)</option>
<option class="locale_fa" value="fa">Persian</option>
<option class="locale_pl" value="pl">Polish</option>
<option class="locale_pt" value="pt">Portuguese (Portugal)</option>
<option class="locale_pt_br" value="pt_br">Portuguese (Brazil)</option>
<option class="locale_ro" value="ro">Romanian</option>
<option class="locale_ru" value="ru">Russian</option>
<option class="locale_sk" value="sk">Slovak</option>
<option class="locale_si" value="si">Slovenian</option>
<option class="locale_es" value="es">Spanish (Spain)</option>
<option class="locale_es_mx" value="es_mx">Spanish (Mexico)</option>
<option class="locale_sv" value="sv">Swedish</option>
<option class="locale_th" value="th">Thai</option>
<option class="locale_tr" value="tr">Turkish</option>
<option class="locale_ua" value="ua">Ukrainian</option>
<option class="locale_vi" value="vi">Vietnamese</option>
</select>
</div>
<div id="gantt_here"></div>
<script>
function changeLocale(lang) {
gantt.i18n.setLocale(lang);
gantt.render();
}

changeLocale("fr")
gantt.plugins({ toolbar: true });
gantt.config.toolbar = { items: [{
id: "locale", comp: "combo", label: "Current locale:", width: 192,
placeholder: "Choose locale", value: "fr", options: [
{ key: '__default__', label: 'Choose locale' },
{ key: 'af', label: 'Afrikaans' },
{ key: 'sq', label: 'Albanian' },
{ key: 'ar', label: 'Arabic' },
{ key: 'be', label: 'Belarusian' },
{ key: 'bs', label: 'Bosnian' },
{ key: 'bg', label: 'Bulgarian' },
{ key: 'ca', label: 'Catalan' },
{ key: 'cn', label: 'Chinese (Simplified)' },
{ key: 'zh_hk', label: 'Chinese (Hong Kong)' },
{ key: 'zh_tw', label: 'Chinese (Taiwan)' },
{ key: 'hr', label: 'Croatian' },
{ key: 'cs', label: 'Czech' },
{ key: 'da', label: 'Danish' },
{ key: 'nl', label: 'Dutch' },
{ key: 'nl_be', label: 'Dutch (Belgium)' },
{ key: '', label: 'English' },
{ key: 'et', label: 'Estonian' },
{ key: 'fi', label: 'Finnish' },
{ key: 'fr', label: 'French (France)' },
{ key: 'fr_ca', label: 'French (Canada)' },
{ key: 'de', label: 'German (Germany)' },
{ key: 'de_at', label: 'German (Austria)' },
{ key: 'el', label: 'Greek' },
{ key: 'he', label: 'Hebrew' },
{ key: 'hu', label: 'Hungarian' },
{ key: 'id', label: 'Indonesian' },
{ key: 'ga', label: 'Irish' },
{ key: 'it', label: 'Italian' },
{ key: 'jp', label: 'Japanese' },
{ key: 'kr', label: 'Korean' },
{ key: 'lv', label: 'Latvian' },
{ key: 'lt', label: 'Lithuanian' },
{ key: 'mk', label: 'Macedonian' },
{ key: 'ms', label: 'Malay' },
{ key: 'nb', label: 'Norwegian (Bokmål)' },
{ key: 'no', label: 'Norwegian (Nynorsk)' },
{ key: 'fa', label: 'Persian' },
{ key: 'pl', label: 'Polish' },
{ key: 'pt', label: 'Portuguese (Portugal)' },
{ key: 'pt_br', label: 'Portuguese (Brazil)' },
{ key: 'ro', label: 'Romanian' },
{ key: 'ru', label: 'Russian' },
{ key: 'sk', label: 'Slovak' },
{ key: 'si', label: 'Slovenian' },
{ key: 'es', label: 'Spanish (Spain)' },
{ key: 'es_mx', label: 'Spanish (Mexico)' },
{ key: 'sv', label: 'Swedish' },
{ key: 'th', label: 'Thai' },
{ key: 'tr', label: 'Turkish' },
{ key: 'ua', label: 'Ukrainian' },
{ key: 'vi', label: 'Vietnamese' }
] }] };
gantt.attachEvent("onToolbarItemChange", function(id, value) {
changeLocale(value === "__default__" ? "" : value);
});
gantt.i18n.setLocale("fr");
gantt.config.layout = withSampleToolbar(gantt.config.layout);
gantt.init("gantt_here");
gantt.parse(demo_tasks);

Expand Down
20 changes: 10 additions & 10 deletions samples/01_initialization/13_project_duration.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@
gantt.parse({
data: [
{id: 11, text: "Project #1", progress: 0.6, open: true},
{id:12, text:"Task #1", start_date:"03-04-2023", duration:"5", parent:11, progress: 1, open: true},
{id:12, text:"Task #1", start_date:"05-04-2027", duration:"5", parent:11, progress: 1, open: true},
{id:13, text:"Task #2", parent:11, progress: 0.5, open: true},
{id:14, text:"Task #3", start_date:"02-04-2023", duration:"6", parent:11, progress: 0.8, open: true},
{id:14, text:"Task #3", start_date:"04-04-2027", duration:"6", parent:11, progress: 0.8, open: true},
{id:15, text:"Task #4", parent:11, progress: 0.2, open: true},
{id:16, text:"Task #5", start_date:"02-04-2023", duration:"7", parent:11, progress: 0, open: true},
{id:17, text:"Task #2.1", start_date:"03-04-2023", duration:"2", parent:13, progress: 1, open: true},
{id:18, text:"Task #2.2", start_date:"06-04-2023", duration:"3", parent:13, progress: 0.8, open: true},
{id:19, text:"Task #2.3", start_date:"10-04-2023", duration:"4", parent:13, progress: 0.2, open: true},
{id:20, text:"Task #2.4", start_date:"10-04-2023", duration:"4", parent:13, progress: 0, open: true},
{id:21, text:"Task #4.1", start_date:"03-04-2023", duration:"4", parent:15, progress: 0.5, open: true},
{id:22, text:"Task #4.2", start_date:"03-04-2023", duration:"4", parent:15, progress: 0.1, open: true},
{id:23, text:"Task #4.3", start_date:"03-04-2023", duration:"5", parent:15, progress: 0, open: true}
{id:16, text:"Task #5", start_date:"04-04-2027", duration:"7", parent:11, progress: 0, open: true},
{id:17, text:"Task #2.1", start_date:"05-04-2027", duration:"2", parent:13, progress: 1, open: true},
{id:18, text:"Task #2.2", start_date:"08-04-2027", duration:"3", parent:13, progress: 0.8, open: true},
{id:19, text:"Task #2.3", start_date:"12-04-2027", duration:"4", parent:13, progress: 0.2, open: true},
{id:20, text:"Task #2.4", start_date:"12-04-2027", duration:"4", parent:13, progress: 0, open: true},
{id:21, text:"Task #4.1", start_date:"05-04-2027", duration:"4", parent:15, progress: 0.5, open: true},
{id:22, text:"Task #4.2", start_date:"05-04-2027", duration:"4", parent:15, progress: 0.1, open: true},
{id:23, text:"Task #4.3", start_date:"05-04-2027", duration:"5", parent:15, progress: 0, open: true}
],
links:[
{id:"10",source:"11",target:"12",type:"1"},
Expand Down
Loading
Loading