I added a new FinishColumn in the format Date, but when I clicked on the cell, the date displayed in the date control didn't match the actual date
/*
* @Description:
* @Version: 2.0
* @Autor: shimnx
* @Date: 2022-05-18 18:17:27
* @LastEditors: shimnx
* @LastEditTime: 2022-12-08 10:30:20
*/
/**
* Status Column implementation file
*/
// Bryntum umd lite bundle comes without polyfills to support Angular's zone.js
import { Column, ColumnStore } from '@bryntum/gantt/gantt.lite.umd.js';
import { DateHelper } from '@bryntum/gantt/gantt.lite.umd.js';
/**
* @module FinishColumn
*/
/**
* A column showing the status of a task
*
* @extends Gantt/column/Column
* @classType FinishColumn
*/
export default class FinishColumn extends Column {
static get $name() {
return 'FinishColumn';
}
static get type() {
return 'finishcolumn';
}
static get isGanttColumn() {
return true;
}
static get defaults() {
return {
// Set your default instance config properties here
field : 'finish',
text : 'Finish Date',
editor : {
type : 'date',
},
htmlEncode : false,
};
}
//endregion
renderer({ record }) {
const finish = DateHelper.format(new Date(record.finish), 'MMM DD, YYYY');
console.log(finish)
return finish ? {
tag : 'i',
className : `b-fa ${finish}`,
html : finish
} : '';
}
}
ColumnStore.registerColumnType(FinishColumn);