make formatdates function shared in utils
This commit is contained in:
@@ -6,7 +6,7 @@ import { useState, useEffect, useRef, useCallback } from "react";
|
||||
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
import PaginationControl from "./pagination";
|
||||
|
||||
import { formatDates } from "../utils";
|
||||
import CryptoJS from "crypto-js";
|
||||
|
||||
import { setCurrentPage } from "../../store/currentView/action";
|
||||
@@ -429,15 +429,6 @@ const DocumentDetails = (props) => {
|
||||
return docObj;
|
||||
};
|
||||
|
||||
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(documentDetailsObj["@odata.count"] / 10);
|
||||
|
||||
let currentPage = 0;
|
||||
|
||||
Reference in New Issue
Block a user