You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/04/25 05:45:50 UTC

[GitHub] [dolphinscheduler] SnowMoon-Dev commented on a diff in pull request #9735: [Fix] add resource capacity required rule

SnowMoon-Dev commented on code in PR #9735:
URL: https://github.com/apache/dolphinscheduler/pull/9735#discussion_r857273990


##########
dolphinscheduler-ui-next/src/common/common.ts:
##########
@@ -314,10 +314,14 @@ export const warningTypeList = [
   }
 ]
 
-export const parseTime = (dateTime: string | number) => {
-  if (_.isString(dateTime) === true) {
-    return parseISO(dateTime as string)
-  } else {
-    return new Date(dateTime)
-  }
+export const parseTime = (dateTime: string | number): Date => {
+  return _.isString(dateTime) === true
+    ? parseISO(dateTime as string)
+    : new Date(dateTime)
+}
+
+export const renderTableTime = (
+  dateTime: string | number | null | undefined

Review Comment:
   ok, i'll change it



##########
dolphinscheduler-ui-next/src/views/resource/task-group/option/use-table.ts:
##########
@@ -139,14 +138,8 @@ export function useTable(
             }
 
             item.projectName = projectName
-            item.createTime = format(
-              parseTime(item.createTime),
-              'yyyy-MM-dd HH:mm:ss'
-            )
-            item.updateTime = format(
-              parseTime(item.updateTime),
-              'yyyy-MM-dd HH:mm:ss'
-            )
+            item.createTime = renderTableTime(item.createTime)

Review Comment:
   ok, i'll change it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org