fix: all format uses lang
This commit is contained in:
parent
d7fb48031a
commit
8152f5ad17
@ -520,7 +520,11 @@ export default class Bar {
|
|||||||
date_utils.diff(task_start, gantt_start, 'month') * 30;
|
date_utils.diff(task_start, gantt_start, 'month') * 30;
|
||||||
const dayInMonth = Math.min(
|
const dayInMonth = Math.min(
|
||||||
29,
|
29,
|
||||||
date_utils.format(task_start, 'DD'),
|
date_utils.format(
|
||||||
|
task_start,
|
||||||
|
'DD',
|
||||||
|
this.gantt.options.language,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
const diff = diffDaysBasedOn30DayMonths + dayInMonth;
|
const diff = diffDaysBasedOn30DayMonths + dayInMonth;
|
||||||
|
|
||||||
|
|||||||
13
src/index.js
13
src/index.js
@ -235,7 +235,11 @@ export default class Gantt {
|
|||||||
this.config.view_mode.format_string || 'YYYY-MM-DD HH';
|
this.config.view_mode.format_string || 'YYYY-MM-DD HH';
|
||||||
|
|
||||||
this.gantt_start = date_utils.parse(
|
this.gantt_start = date_utils.parse(
|
||||||
date_utils.format(gantt_start, format_string),
|
date_utils.format(
|
||||||
|
gantt_start,
|
||||||
|
format_string,
|
||||||
|
this.options.language,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
this.gantt_start.setHours(0, 0, 0, 0);
|
this.gantt_start.setHours(0, 0, 0, 0);
|
||||||
this.gantt_end = date_utils.add(
|
this.gantt_end = date_utils.add(
|
||||||
@ -570,7 +574,11 @@ export default class Gantt {
|
|||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
x: (diff_in_units / this.config.step) * this.config.column_width,
|
x: (diff_in_units / this.config.step) * this.config.column_width,
|
||||||
date: date_utils.format(today, this.config.view_mode.format_string),
|
date: date_utils.format(
|
||||||
|
today,
|
||||||
|
this.config.view_mode.format_string,
|
||||||
|
this.options.language,
|
||||||
|
),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -869,6 +877,7 @@ export default class Gantt {
|
|||||||
let currentUpper = date_utils.format(
|
let currentUpper = date_utils.format(
|
||||||
date_utils.add(this.gantt_start, daysSinceStart, 'day'),
|
date_utils.add(this.gantt_start, daysSinceStart, 'day'),
|
||||||
format_str,
|
format_str,
|
||||||
|
this.options.language,
|
||||||
);
|
);
|
||||||
const upperTexts = Array.from(
|
const upperTexts = Array.from(
|
||||||
document.querySelectorAll('.upper-text'),
|
document.querySelectorAll('.upper-text'),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user