diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js index 0c6136de38e8a14cd9e490e0694567cd53c22134..6ef51f1b85cf743350f1228aa7debe4ca8b0f6a2 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js @@ -1,6 +1,6 @@ import React, { Component } from 'react' import 'primeflex/primeflex.css'; -import moment from 'moment'; +import moment, { duration } from 'moment'; import AppLoader from "./../../layout/components/AppLoader"; import ViewTable from './../../components/ViewTable'; @@ -37,6 +37,8 @@ class SchedulingUnitList extends Component{ }] } } + + async getSchedulingUnitList () { const bluePrint = await ScheduleService.getSchedulingUnitBlueprint(); @@ -46,7 +48,7 @@ class SchedulingUnitList extends Component{ for( const scheduleunit of scheduleunits){ const blueprintdata = bluePrint.data.results.filter(i => i.draft_id === scheduleunit.id); blueprintdata.map(blueP => { - blueP.duration = moment(blueP.duration).format('HH:mm:ss'); + blueP.duration = moment.utc(blueP.duration*1000).format('HH:mm:ss'); blueP.type="Blueprint"; blueP['actionpath'] = '/task/view/type/id'; return blueP; @@ -54,8 +56,7 @@ class SchedulingUnitList extends Component{ output.push(...blueprintdata); scheduleunit['actionpath']='/schedulingunit/view'; scheduleunit['type'] = 'Scheduling Unit'; - // scheduleunit['stop_time'] = blueprintdata.stop_time; - scheduleunit['duration'] = moment(scheduleunit.duration).format('HH:mm:ss'); + scheduleunit['duration'] = moment.utc(scheduleunit.duration*1000).format('HH:mm:ss'); output.push(scheduleunit); } this.setState({