|
|
@ -25,11 +25,15 @@ const renderResult = (result?: any) => { |
|
|
|
return result |
|
|
|
return result |
|
|
|
} |
|
|
|
} |
|
|
|
// 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 datetime is either YYYY-MM-DD hh:mm:ss (xcdb) |
|
|
|
return result.replace(/\b(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\+\d{2}:\d{2})\b/g, (d) => { |
|
|
|
// or YYYY-MM-DD hh:mm:ss+xx:yy (ext) |
|
|
|
|
|
|
|
return result.replace('.000000', '').replace(/\b(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})(\+\d{2}:\d{2})?\b/g, (d) => { |
|
|
|
// TODO(timezone): retrieve the format from the corresponding column meta |
|
|
|
// TODO(timezone): retrieve the format from the corresponding column meta |
|
|
|
// assume hh:mm at this moment |
|
|
|
// assume hh:mm at this moment |
|
|
|
return dayjs(d).utc().local().format('YYYY-MM-DD HH:mm') |
|
|
|
return dayjs(d) |
|
|
|
|
|
|
|
.utc(result.indexOf('+') === -1) |
|
|
|
|
|
|
|
.local() |
|
|
|
|
|
|
|
.format('YYYY-MM-DD HH:mm') |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|