defect 7 - case refresh error
This commit is contained in:
@@ -128,9 +128,11 @@ const DocumentDetails = (props) => {
|
||||
{_.has(historyObj, [
|
||||
"pinswg_publisheddate@OData.Community.Display.V1.FormattedValue",
|
||||
])
|
||||
? historyObj[
|
||||
"pinswg_publisheddate@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
? formatDates(
|
||||
historyObj[
|
||||
"pinswg_publisheddate@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
)
|
||||
: ""}
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-14">
|
||||
@@ -194,6 +196,15 @@ const DocumentDetails = (props) => {
|
||||
const searchDocumentResultsObj = docDetailsObj();
|
||||
}, [incidentid, setDocumentHistory, setDocumentDetails]);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="govuk-grid-row">
|
||||
|
||||
Reference in New Issue
Block a user