fix: date UTC conversion issue

fix: `type.create` index offset issue
This commit is contained in:
2024-03-27 02:30:04 +08:00
parent fd8899c597
commit 87e3d6c81b
3 changed files with 22 additions and 24 deletions

View File

@ -768,7 +768,10 @@ export class GridDateColumn extends GridColumn {
* @returns {string}
*/
static getValue(e, col) {
return getDateValue(e.target, col.dateValueFormatter);
if (e.target.tagName === 'INPUT') {
return getDateValue(e.target, col.dateValueFormatter);
}
return e.target.innerText;
}
/**

View File

@ -2652,7 +2652,7 @@ export class Grid {
if (!readonly && GridColumnTypeEnum.isAlwaysEditing(col.type)) {
element = type.createEdit(e => this._onRowChanged(e, exists + i, col, e.target.checked, cell), col, exists + i);
} else {
element = type.create(col, i, this);
element = type.create(col, exists + i, this);
if (typeof col.class === 'string') {
type.setClass(element, col.class);
}