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;
30
30
class VolunteerHistory extends Component {
31
31
32
32
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" ) ;
35
36
} ) . reverse ( ) ;
36
37
37
38
const lastShifts = shiftsSorted . slice ( 0 , SHIFTS_TO_SHOW )
39
+
38
40
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" )
40
42
return ( < TableRow key = { index } >
41
43
< TableCell > { shift . from } </ TableCell >
42
44
< TableCell > { shift . assignment } </ TableCell >
You can’t perform that action at this time.
0 commit comments