make formatdates function shared in utils
This commit is contained in:
@@ -10,6 +10,7 @@ import transLookup from "../../data/lookuptranslations.json";
|
||||
import { getRepresentations } from "../../actions";
|
||||
import { setRepresentations } from "../../store/searchOutput/action";
|
||||
import PaginationControl from "./pagination";
|
||||
import { formatDates } from "../utils";
|
||||
|
||||
const RepresentationList = (props) => {
|
||||
const { incidentid, representationsObj, setRepresentations } = props;
|
||||
@@ -153,15 +154,6 @@ const RepresentationList = (props) => {
|
||||
const representationResultsObj = representationDetailsObj();
|
||||
}, [incidentid, setRepresentations]);
|
||||
|
||||
function formatDates(dateObj) {
|
||||
var dateObj = new Date(dateObj);
|
||||
var dd = String(dateObj.getDate()).padStart(2, "0");
|
||||
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
|
||||
var yyyy = dateObj.getFullYear();
|
||||
|
||||
return dd + "/" + mm + "/" + yyyy;
|
||||
}
|
||||
|
||||
const pagesCount = Math.ceil(representationsObj["@odata.count"] / 10);
|
||||
|
||||
let currentPage = 0;
|
||||
|
||||
Reference in New Issue
Block a user