Fixed some issues with ordering in report form code.

This commit is contained in:
wildscotsmen 2018-10-29 00:38:19 -04:00
parent c9f22b74d5
commit 4617f31be2
1 changed files with 32 additions and 32 deletions

View File

@ -211,6 +211,38 @@ class ReportForm extends React.Component {
this.handleSubmit = this.handleSubmit.bind(this);
}
/**
* Function for formatting the
* year as a string that
* Material UI can use.
* @param {*} date, Date passed in.
*/
getYear = date => {
var d = new Date(date),
year = d.getFullYear();
return year;
}
/**
* Function for formatting the
* month as a string that
* Material UI can use.
* @param {*} date, Date passed in.
*/
getMonth = date => {
var d = new Date(date),
month = d.getMonth() + 1;
month = month.toString();
if (month.length === 1) {
month = "0" + month;
}
return month;
}
/**
* State of form components.
*/
@ -236,38 +268,6 @@ class ReportForm extends React.Component {
});
};
/**
* Function for formatting the
* year as a string that
* Material UI can use.
* @param {*} date, Date passed in.
*/
getYear = date => {
var d = new Date(date),
year = d.getFullYear();
return year;
}
/**
* Function for formatting the
* month as a string that
* Material UI can use.
* @param {*} date, Date passed in.
*/
getMonth = date => {
var d = new Date(date),
month = d.getMonth();
month = month.toString();
if (month.length == 1) {
month = "0" + month;
}
return month;
}
/**
* Handles closing the toast.
*/