File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/client/src/pages/DataView360/View/components Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -30,13 +30,15 @@ const SHIFTS_TO_SHOW = 3;
3030class VolunteerHistory extends Component {
3131
3232 createShiftRows ( shifts ) {
33- const shiftsSorted = _ . sortBy ( shifts , shift => {
34- return new moment ( shift . from ) ;
33+ const shiftsFiltered = _ . filter ( shifts , function ( s ) { return s . from !== "Invalid date" } ) ;
34+ const shiftsSorted = _ . sortBy ( shiftsFiltered , shift => {
35+ return new moment ( shift . from ) . format ( "YYYY-MM-DD" ) ;
3536 } ) . reverse ( ) ;
3637
3738 const lastShifts = shiftsSorted . slice ( 0 , SHIFTS_TO_SHOW )
39+
3840 const result = _ . map ( lastShifts , ( shift , index ) => {
39- shift . from = ( shift . from === "Invalid date" ) ? "Unknown" : moment ( shift . from ) . format ( "MM-DD-YYYY " )
41+ shift . from = moment ( shift . from ) . format ( "YYYY- MM-DD" )
4042 return ( < TableRow key = { index } >
4143 < TableCell > { shift . from } </ TableCell >
4244 < TableCell > { shift . assignment } </ TableCell >
You can’t perform that action at this time.
0 commit comments