make formatdates function shared in utils

This commit is contained in:
2023-10-24 07:35:43 +01:00
parent 0c98bcd831
commit 798ba01ea6
6 changed files with 481 additions and 110 deletions
+1 -10
View File
@@ -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;