Skip to content
Snippets Groups Projects
Commit 39d0ec39 authored by Nithya's avatar Nithya
Browse files
Duration Updated
parent 5acf2e9d
No related branches found
No related tags found
1 merge request!198Resolve TMSS-268
import React, { Component } from 'react' import React, { Component } from 'react'
import 'primeflex/primeflex.css'; import 'primeflex/primeflex.css';
import moment from 'moment'; import moment, { duration } from 'moment';
import AppLoader from "./../../layout/components/AppLoader"; import AppLoader from "./../../layout/components/AppLoader";
import ViewTable from './../../components/ViewTable'; import ViewTable from './../../components/ViewTable';
...@@ -37,6 +37,8 @@ class SchedulingUnitList extends Component{ ...@@ -37,6 +37,8 @@ class SchedulingUnitList extends Component{
}] }]
} }
} }
async getSchedulingUnitList () { async getSchedulingUnitList () {
const bluePrint = await ScheduleService.getSchedulingUnitBlueprint(); const bluePrint = await ScheduleService.getSchedulingUnitBlueprint();
...@@ -46,7 +48,7 @@ class SchedulingUnitList extends Component{ ...@@ -46,7 +48,7 @@ class SchedulingUnitList extends Component{
for( const scheduleunit of scheduleunits){ for( const scheduleunit of scheduleunits){
const blueprintdata = bluePrint.data.results.filter(i => i.draft_id === scheduleunit.id); const blueprintdata = bluePrint.data.results.filter(i => i.draft_id === scheduleunit.id);
blueprintdata.map(blueP => { 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.type="Blueprint";
blueP['actionpath'] = '/task/view/type/id'; blueP['actionpath'] = '/task/view/type/id';
return blueP; return blueP;
...@@ -54,8 +56,7 @@ class SchedulingUnitList extends Component{ ...@@ -54,8 +56,7 @@ class SchedulingUnitList extends Component{
output.push(...blueprintdata); output.push(...blueprintdata);
scheduleunit['actionpath']='/schedulingunit/view'; scheduleunit['actionpath']='/schedulingunit/view';
scheduleunit['type'] = 'Scheduling Unit'; scheduleunit['type'] = 'Scheduling Unit';
// scheduleunit['stop_time'] = blueprintdata.stop_time; scheduleunit['duration'] = moment.utc(scheduleunit.duration*1000).format('HH:mm:ss');
scheduleunit['duration'] = moment(scheduleunit.duration).format('HH:mm:ss');
output.push(scheduleunit); output.push(scheduleunit);
} }
this.setState({ this.setState({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment