Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
netchampfaris committed Sep 23, 2018
1 parent af45438 commit 48ea5ad
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion index.html
Expand Up @@ -80,7 +80,7 @@ <h2>Interactive Gantt Chart entirely made in SVG!</h2>
end: '2019-10-12',
name: 'Long term task',
id: "Task 6",
progress: 0
progress: 0
}
]
var gantt_chart = new Gantt(".gantt-target", tasks, {
Expand Down
27 changes: 23 additions & 4 deletions src/index.js
Expand Up @@ -68,7 +68,14 @@ export default class Gantt {
header_height: 50,
column_width: 30,
step: 24,
view_modes: ['Quarter Day', 'Half Day', 'Day', 'Week', 'Month', 'Year'],
view_modes: [
'Quarter Day',
'Half Day',
'Day',
'Week',
'Month',
'Year'
],
bar_height: 20,
bar_corner_radius: 3,
arrow_curve: 5,
Expand Down Expand Up @@ -244,7 +251,11 @@ export default class Gantt {
} else if (this.view_is('Month')) {
cur_date = date_utils.add(cur_date, 1, 'month');
} else {
cur_date = date_utils.add(cur_date, this.options.step, 'hour');
cur_date = date_utils.add(
cur_date,
this.options.step,
'hour'
);
}
}
this.dates.push(cur_date);
Expand Down Expand Up @@ -470,8 +481,16 @@ export default class Gantt {
last_date = date_utils.add(date, 1, 'year');
}
const date_text = {
'Quarter Day_lower': date_utils.format(date, 'HH', this.options.language),
'Half Day_lower': date_utils.format(date, 'HH', this.options.language),
'Quarter Day_lower': date_utils.format(
date,
'HH',
this.options.language
),
'Half Day_lower': date_utils.format(
date,
'HH',
this.options.language
),
Day_lower:
date.getDate() !== last_date.getDate()
? date_utils.format(date, 'D', this.options.language)
Expand Down

0 comments on commit 48ea5ad

Please sign in to comment.