File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,8 +72,8 @@ const RouteLocations = (props) => {
7272 for ( let i = 0 ; i < tracePoints [ position ] . length ; i += 1 ) {
7373 if ( i !== tracePoints [ position ] . length - 1 ) {
7474 // Calc time difference (when not at the end of array):
75- // Using Date.parse() because timeSent's value is a string .
76- const timeDiff = Date . parse ( tracePoints [ position ] [ i + 1 ] . timeSent ) - Date . parse ( tracePoints [ position ] [ i ] . timeSent ) ;
75+ // Convert time str to Date obj w/ new Date(), then get the time difference .
76+ const timeDiff = new Date ( tracePoints [ position ] [ i + 1 ] . timeSent ) - new Date ( tracePoints [ position ] [ i ] . timeSent ) ;
7777 resArray . push (
7878 < div className = "RouteCircle" key = { i } >
7979 { /* Altering this <p> so it displays only microsvc_name */ }
@@ -83,7 +83,6 @@ const RouteLocations = (props) => {
8383 { /* Adding another <p> that displays time difference btw curr obj and next obj */ }
8484 < p id = "routeTimeDiff" >
8585 { /* Time: {tracePoints[position][i].timeSent} */ }
86- { /* What datatype? {Date.parse(tracePoints[position][i].timeSent) - Date.parse(tracePoints[position][i + 1].timeSent)} ms */ }
8786 Time elapsed: { timeDiff } ms
8887 </ p >
8988 </ div > ,
You can’t perform that action at this time.
0 commit comments