Skip to content

Commit d7c5185

Browse files
committed
Bugfix: now shows 'N/A' instead of 'Invalid date'
1 parent 8ca8399 commit d7c5185

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/client/src/pages/DataView360/View/components/VolunteerActivity.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ const customStyles = theme => ({
3131
class volunteerActivity extends Component {
3232

3333
render() {
34-
const {classes} = this.props;
35-
34+
const {classes, volunteer} = this.props;
3635
return (
3736
<React.Fragment>
3837
<Container component={Paper} style={{"marginTop": "1em"}}>
@@ -51,9 +50,14 @@ class volunteerActivity extends Component {
5150
<TableBody>
5251
{ this.props.volunteer && (
5352
<TableRow>
54-
<TableCell>{moment(this.props.volunteer.start_date).format("MM-DD-YYYY")}</TableCell>
55-
<TableCell>{this.props.volunteer.life_hours.toFixed(2)}</TableCell>
56-
<TableCell>{this.props.volunteer.ytd_hours.toFixed(2)}</TableCell>
53+
<TableCell>{
54+
(volunteer.start_date === "N/A")
55+
? "N/A"
56+
: moment(volunteer.start_date).format("MM-DD-YYYY")
57+
}
58+
</TableCell>
59+
<TableCell>{volunteer.life_hours.toFixed(2)}</TableCell>
60+
<TableCell>{volunteer.ytd_hours.toFixed(2)}</TableCell>
5761
</TableRow>
5862
)}
5963
</TableBody>

0 commit comments

Comments
 (0)