fix: date time undefined get

This commit is contained in:
Nathan
2025-10-30 20:47:18 +08:00
parent da0a9dbc71
commit 864540e31c
2 changed files with 34 additions and 12 deletions

View File

@@ -1235,11 +1235,12 @@ export const useRowTimeString = (rowId: string, fieldId: string, attrName: strin
const typeOption = getTypeOptions(field);
const { dateFormat, timeFormat } = getFieldDateTimeFormats(typeOption, currentUser);
const includeTimeRaw = typeOption?.get(YjsDatabaseKey.include_time);
return {
dateFormat,
timeFormat,
includeTime: typeOption.get(YjsDatabaseKey.include_time),
includeTime: typeof includeTimeRaw === 'boolean' ? includeTimeRaw : Boolean(includeTimeRaw),
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [field, clock, currentUser?.metadata]);