diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-02-24 14:38:47 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2016-02-24 14:38:47 +0100 |
commit | e867b34cb7ab0252dc69746aee1333bd7945ac36 (patch) | |
tree | 433ad2e03f036f376e38fef44635f8890b00c16d /server/sonar-web/src/main/js/apps/background-tasks | |
parent | 1948216202698bac30f7a5675997171d855602ee (diff) | |
download | sonarqube-e867b34cb7ab0252dc69746aee1333bd7945ac36.tar.gz sonarqube-e867b34cb7ab0252dc69746aee1333bd7945ac36.zip |
display if background task processing crossed midnight
Diffstat (limited to 'server/sonar-web/src/main/js/apps/background-tasks')
-rw-r--r-- | server/sonar-web/src/main/js/apps/background-tasks/components/Task.js | 6 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/apps/background-tasks/components/TaskDate.js | 10 |
2 files changed, 12 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Task.js b/server/sonar-web/src/main/js/apps/background-tasks/components/Task.js index c8bbf919a95..ad384d12529 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/Task.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Task.js @@ -41,9 +41,9 @@ export default function Task ({ task, index, tasks, component, onCancelTask, onF <TaskStatus task={task}/> <TaskComponent task={task}/> <TaskDay task={task} prevTask={prevTask}/> - <TaskDate date={task.submittedAt} format="LTS"/> - <TaskDate date={task.startedAt} format="LTS"/> - <TaskDate date={task.executedAt} format="LTS"/> + <TaskDate date={task.submittedAt} baseDate={task.submittedAt} format="LTS"/> + <TaskDate date={task.startedAt} baseDate={task.submittedAt} format="LTS"/> + <TaskDate date={task.executedAt} baseDate={task.submittedAt} format="LTS"/> <TaskExecutionTime task={task}/> <td className="thin nowrap text-right"> diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskDate.js b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskDate.js index 5c8759cfa9e..568b65df97b 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskDate.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskDate.js @@ -20,9 +20,17 @@ import moment from 'moment'; import React from 'react'; -export default function TaskDate ({ date, format }) { +export default function TaskDate ({ date, baseDate, format }) { + const m = moment(date); + const baseM = moment(baseDate); + const diff = (date && baseDate) ? m.diff(baseM, 'days') : 0; + return ( <td className="thin nowrap text-right"> + {diff > 0 && ( + <span className="text-warning little-spacer-right">{`(+${diff})`}</span> + )} + {date ? moment(date).format(format) : ''} </td> ); |