Browse Source

fix(nc-gui): handle null formula result case

pull/5659/head
Wing-Kam Wong 2 years ago
parent
commit
f5e7e1350e
  1. 5
      packages/nc-gui/components/virtual-cell/Formula.vue

5
packages/nc-gui/components/virtual-cell/Formula.vue

@ -18,7 +18,10 @@ const urls = computed(() => replaceUrlsWithLink(result.value))
const { showEditNonEditableFieldWarning, showClearNonEditableFieldWarning, activateShowEditNonEditableFieldWarning } = const { showEditNonEditableFieldWarning, showClearNonEditableFieldWarning, activateShowEditNonEditableFieldWarning } =
useShowNotEditableWarning() useShowNotEditableWarning()
const renderResult = (result: string) => { const renderResult = (result?: string | null) => {
if (!result) {
return ''
}
// convert all date time values to local time // convert all date time values to local time
// the input is always YYYY-MM-DD hh:mm:ss+xx:yy // the input is always YYYY-MM-DD hh:mm:ss+xx:yy
return result.replace(/\b(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\+\d{2}:\d{2})\b/g, (d) => { return result.replace(/\b(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\+\d{2}:\d{2})\b/g, (d) => {

Loading…
Cancel
Save