lixmgl commented on code in PR #94:
URL: https://github.com/apache/yunikorn-web/pull/94#discussion_r1029784177


##########
src/app/models/app-info.model.ts:
##########
@@ -31,24 +31,35 @@ export class AppInfo {
     public queueName: string,
     public submissionTime: number,
     public finishedTime: null | number,
+    public lastStateChangeTime: null | number,
     public applicationState: string,
     public allocations: AllocationInfo[] | null
-  ) {}
+  ) { }
 
   get formattedSubmissionTime() {
-    const millisecs = Math.round(this.submissionTime / (1000 * 1000));
-    return moment(millisecs).format('YYYY/MM/DD HH:mm:ss');
+    return this.formatTime(this.submissionTime)
   }
 
   get formattedFinishedTime() {
-    if (this.finishedTime) {
-      const millisecs = Math.round(this.finishedTime / (1000 * 1000));
-      return moment(millisecs).format('YYYY/MM/DD HH:mm:ss');
-    }
+    return this.formatTimeIfNotNull(this.finishedTime)
+  }
+
+  get formattedLastStateChangeTime() {
+    return this.formatTimeIfNotNull(this.lastStateChangeTime)
+  }
 
+  formatTimeIfNotNull(unformattedtime: null | number) {

Review Comment:
   moved. 



##########
src/app/models/app-info.model.ts:
##########
@@ -31,24 +31,35 @@ export class AppInfo {
     public queueName: string,
     public submissionTime: number,
     public finishedTime: null | number,
+    public lastStateChangeTime: null | number,
     public applicationState: string,
     public allocations: AllocationInfo[] | null
-  ) {}
+  ) { }
 
   get formattedSubmissionTime() {
-    const millisecs = Math.round(this.submissionTime / (1000 * 1000));
-    return moment(millisecs).format('YYYY/MM/DD HH:mm:ss');
+    return this.formatTime(this.submissionTime)
   }
 
   get formattedFinishedTime() {
-    if (this.finishedTime) {
-      const millisecs = Math.round(this.finishedTime / (1000 * 1000));
-      return moment(millisecs).format('YYYY/MM/DD HH:mm:ss');
-    }
+    return this.formatTimeIfNotNull(this.finishedTime)
+  }
+
+  get formattedLastStateChangeTime() {
+    return this.formatTimeIfNotNull(this.lastStateChangeTime)
+  }
 
+  formatTimeIfNotNull(unformattedtime: null | number) {
+    if (unformattedtime) {
+      return this.formatTime(unformattedtime)

Review Comment:
   updated. 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to