fix: changes from #397

This commit is contained in:
Safwan Samsudeen 2024-09-11 20:51:53 +05:30
parent faf41b7220
commit af206ebbd7
2 changed files with 5 additions and 16 deletions

View File

@ -6,20 +6,6 @@ const MINUTE = 'minute';
const SECOND = 'second';
const MILLISECOND = 'millisecond';
const SHORTENED = {
January: 'Jan',
February: 'Feb',
March: 'Mar',
April: 'Apr',
May: 'May',
June: 'Jun',
July: 'Jul',
August: 'Aug',
September: 'Sep',
October: 'Oct',
November: 'Nov',
December: 'Dec',
};
export default {
parse_duration(duration) {
@ -97,6 +83,9 @@ export default {
const dateTimeFormat = new Intl.DateTimeFormat(lang, {
month: 'long',
});
const dateTimeFormatShort = new Intl.DateTimeFormat(lang, {
month: "short",
});
const month_name = dateTimeFormat.format(date);
const month_name_capitalized =
month_name.charAt(0).toUpperCase() + month_name.slice(1);
@ -112,7 +101,7 @@ export default {
SSS: values[6],
D: values[2],
MMMM: month_name_capitalized,
MMM: SHORTENED[month_name_capitalized],
MMM: dateTimeFormatShort.format(date),
};
let str = format_string;

View File

@ -867,7 +867,7 @@ export default class Gantt {
formatted_date: date_utils.format(date).replaceAll(' ', '_'),
column_width,
base_pos_x: base_pos.x,
upper_text: this.options.lower_text
upper_text: this.options.upper_text
? this.options.upper_text(
date,
this.options.view_mode,