From 4617f31be21b9e5e56f3c76fc33b07180785ffee Mon Sep 17 00:00:00 2001 From: wildscotsmen Date: Mon, 29 Oct 2018 00:38:19 -0400 Subject: [PATCH] Fixed some issues with ordering in report form code. --- src/components/ReportForm.js | 64 ++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/components/ReportForm.js b/src/components/ReportForm.js index b30952d..9068eec 100644 --- a/src/components/ReportForm.js +++ b/src/components/ReportForm.js @@ -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. */