adjusted timetable to display correct dates
This commit is contained in:
@@ -229,7 +229,7 @@ let MakeRepresentation = (props) => {
|
||||
const buildRepsArr = (detailsObj) => {
|
||||
let buildArr = [];
|
||||
|
||||
console.log(currentView.caseReference.appealType);
|
||||
console.log(currentView.caseReference.appealType, "");
|
||||
|
||||
let todaysDate = new Date();
|
||||
|
||||
@@ -241,62 +241,50 @@ let MakeRepresentation = (props) => {
|
||||
let statementDueDate;
|
||||
|
||||
isDNS
|
||||
? (startDate = new Date(
|
||||
? ((startDate = new Date(
|
||||
detailsObj.pinswg_applicationacceptedasvalid
|
||||
)),
|
||||
(questionnaireDate = new Date(
|
||||
new Date(
|
||||
detailsObj.pinswg_applicationacceptedasvalid
|
||||
detailsObj.pinswg_endofrepresentationperiod
|
||||
).setHours(23, 59, 59, 999)
|
||||
))(
|
||||
(questionnaireDate = new Date(
|
||||
new Date(
|
||||
detailsObj.pinswg_endofrepresentationperiod
|
||||
).setHours(23, 59, 59, 999)
|
||||
))
|
||||
)(
|
||||
(finalCommentsDate = new Date(
|
||||
new Date(detailsObj.pinswg_finalcommentsduedate).setHours(
|
||||
23,
|
||||
59,
|
||||
59,
|
||||
999
|
||||
)
|
||||
))
|
||||
)(
|
||||
(statementDueDate = new Date(
|
||||
new Date(
|
||||
detailsObj.pinswg_endofrepresentationperiod
|
||||
).setHours(23, 59, 59, 999)
|
||||
))
|
||||
)
|
||||
: (startDate = new Date(
|
||||
new Date(detailsObj.pinswg_startdate).setHours(
|
||||
)),
|
||||
(finalCommentsDate = new Date(
|
||||
new Date(detailsObj.pinswg_finalcommentsduedate).setHours(
|
||||
23,
|
||||
59,
|
||||
59,
|
||||
999
|
||||
)
|
||||
)),
|
||||
(questionnaireDate = new Date(
|
||||
new Date(detailsObj.pinswg_questionnaireduedate).setHours(
|
||||
23,
|
||||
59,
|
||||
59,
|
||||
999
|
||||
)
|
||||
)),
|
||||
(finalCommentsDate = new Date(
|
||||
new Date(detailsObj.pinswg_finalcommentsduedate).setHours(
|
||||
23,
|
||||
59,
|
||||
59,
|
||||
999
|
||||
)
|
||||
)),
|
||||
(statementDueDate = new Date(
|
||||
new Date(
|
||||
detailsObj.pinswg_statementduedate ||
|
||||
detailsObj.pinswg_statementsduedate
|
||||
).setHours(23, 59, 59, 999)
|
||||
));
|
||||
(statementDueDate = new Date(
|
||||
new Date(
|
||||
detailsObj.pinswg_endofrepresentationperiod
|
||||
).setHours(23, 59, 59, 999)
|
||||
)))
|
||||
: ((startDate = new Date(detailsObj.pinswg_startdate)),
|
||||
(questionnaireDate = new Date(
|
||||
new Date(detailsObj.pinswg_questionnaireduedate).setHours(
|
||||
23,
|
||||
59,
|
||||
59,
|
||||
999
|
||||
)
|
||||
)),
|
||||
(finalCommentsDate = new Date(
|
||||
new Date(detailsObj.pinswg_finalcommentsduedate).setHours(
|
||||
23,
|
||||
59,
|
||||
59,
|
||||
999
|
||||
)
|
||||
)),
|
||||
(statementDueDate = new Date(
|
||||
new Date(
|
||||
detailsObj.pinswg_statementduedate ||
|
||||
detailsObj.pinswg_statementsduedate
|
||||
).setHours(23, 59, 59, 999)
|
||||
)));
|
||||
|
||||
isLPA &&
|
||||
currentView.caseReference.appealType != 846040019 &&
|
||||
@@ -795,6 +783,10 @@ let MakeRepresentation = (props) => {
|
||||
props.props.currentView.caseReference.currentReference,
|
||||
"pinswg_questionnaireduedate":
|
||||
detailsObj.pinswg_questionnaireduedate,
|
||||
"pinswg_endofrepresentationperiod":
|
||||
detailsObj.pinswg_endofrepresentationperiod,
|
||||
"pinswg_applicationacceptedasvalid":
|
||||
detailsObj.pinswg_applicationacceptedasvalid,
|
||||
"pinswg_statementduedate": detailsObj.pinswg_statementduedate,
|
||||
"pinswg_finalcommentsduedate":
|
||||
detailsObj.pinswg_finalcommentsduedate,
|
||||
@@ -1048,64 +1040,69 @@ let MakeRepresentation = (props) => {
|
||||
</div>
|
||||
</div>
|
||||
</div>{" "}
|
||||
{Object.keys(
|
||||
{typeof props.props.currentView
|
||||
.representationCapacity !=
|
||||
"undefined" &&
|
||||
props.props.currentView
|
||||
.representationCapacity
|
||||
).length > 0 && (
|
||||
<div className="govuk-grid-row">
|
||||
{savingStatus ? (
|
||||
<span className=" progress-save-active">
|
||||
{router.locale == "cy"
|
||||
? "Nôl data"
|
||||
: "Saving data"}
|
||||
<img
|
||||
className="data-loading-icon"
|
||||
src="/assets/images/loading.gif"
|
||||
alt={
|
||||
router.locale ==
|
||||
"cy"
|
||||
? "Nôl data"
|
||||
: "Saving data"
|
||||
}
|
||||
/>
|
||||
</span>
|
||||
) : (
|
||||
<button
|
||||
className="govuk-button govuk-button--secondary progress-save "
|
||||
onClick={() => {
|
||||
let valuesObj =
|
||||
props.props
|
||||
.form[
|
||||
props.form
|
||||
].values || {};
|
||||
.representationCapacity.length >
|
||||
0 && (
|
||||
<div className="govuk-grid-row">
|
||||
{savingStatus ? (
|
||||
<span className=" progress-save-active">
|
||||
{router.locale ==
|
||||
"cy"
|
||||
? "Nôl data"
|
||||
: "Saving data"}
|
||||
<img
|
||||
className="data-loading-icon"
|
||||
src="/assets/images/loading.gif"
|
||||
alt={
|
||||
router.locale ==
|
||||
"cy"
|
||||
? "Nôl data"
|
||||
: "Saving data"
|
||||
}
|
||||
/>
|
||||
</span>
|
||||
) : (
|
||||
<button
|
||||
className="govuk-button govuk-button--secondary progress-save "
|
||||
onClick={() => {
|
||||
let valuesObj =
|
||||
props.props
|
||||
.form[
|
||||
props
|
||||
.form
|
||||
].values ||
|
||||
{};
|
||||
|
||||
console.log(
|
||||
"valuesobj:",
|
||||
valuesObj
|
||||
);
|
||||
console.log(
|
||||
"valuesobj:",
|
||||
valuesObj
|
||||
);
|
||||
|
||||
delete valuesObj[
|
||||
"_pinswg_appellant_value"
|
||||
];
|
||||
delete valuesObj[
|
||||
"_pinswg_appellant_value"
|
||||
];
|
||||
|
||||
console.log(
|
||||
"on save:",
|
||||
valuesObj
|
||||
);
|
||||
updateRepresentation(
|
||||
valuesObj,
|
||||
false,
|
||||
true
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t(
|
||||
"common:save-exit-button"
|
||||
)}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
console.log(
|
||||
"on save:",
|
||||
valuesObj
|
||||
);
|
||||
updateRepresentation(
|
||||
valuesObj,
|
||||
false,
|
||||
true
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t(
|
||||
"common:save-exit-button"
|
||||
)}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<div>
|
||||
{formObj.hasOwnProperty(
|
||||
"representationForm"
|
||||
|
||||
Reference in New Issue
Block a user