فهرست منبع

fix datanode date error (#1046)

resolves #1043

Co-authored-by: Fred Lefévère-Laoide <Fred.Lefevere-Laoide@Taipy.io>
Fred Lefévère-Laoide 1 سال پیش
والد
کامیت
b24a8d2c74
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      frontend/taipy/src/DataNodeViewer.tsx

+ 2 - 2
frontend/taipy/src/DataNodeViewer.tsx

@@ -804,7 +804,7 @@ const DataNodeViewer = (props: DataNodeViewerProps) => {
                                                                 </Tooltip>
                                                             </Grid>
                                                         </>
-                                                    ) : dtType == "date" ? (
+                                                    ) : dtType == "date" && (dataValue === null || dataValue instanceof Date)  ? (
                                                         <LocalizationProvider dateAdapter={AdapterDateFns}>
                                                             <Grid item xs={10}>
                                                                 <DateTimePicker
@@ -897,7 +897,7 @@ const DataNodeViewer = (props: DataNodeViewerProps) => {
                                                         ) : (
                                                             <Typography variant="subtitle2">
                                                                 {dtType == "date"
-                                                                    ? dataValue &&
+                                                                    ? (dataValue === null || dataValue instanceof Date) &&
                                                                       format(dataValue as Date, "yyyy/MM/dd HH:mm:ss")
                                                                     : dtType == "float" && dtValue === null
                                                                     ? "NaN"