Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "name-request",
"version": "5.10.6",
"version": "5.10.7",
"private": true,
"engines": {
"node": ">=24"
Expand Down
17 changes: 10 additions & 7 deletions app/src/store/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@
return state.newRequestModel.nr.state
}

export const getNrSubmittedDate = (state: StateIF): Date => {
return state.newRequestModel.nr.submittedDate
}

export const getLocation = (state: StateIF): Location => {
return state.newRequestModel.location
}
Expand Down Expand Up @@ -1337,11 +1341,10 @@
return '-'
}

function formatDate (statVal: number): string {
const today = new Date()
const result = new Date(today)
function formatDate(statVal: number, submittedDate: Date): string {

Check failure on line 1344 in app/src/store/getters.ts

View workflow job for this annotation

GitHub Actions / namerequest-ci / linting-pnpm (24, 11.9.0)

Missing space before function parentheses
const result = new Date(submittedDate)

result.setDate(today.getDate() + statVal)
result.setDate(result.getDate() + statVal)
const formatted = result.toLocaleDateString('en-CA', {
year: 'numeric',
month: 'long',
Expand All @@ -1356,10 +1359,10 @@

export const getRegularEstimateReviewDate = (state: StateIF): string => {
const flagVal = GetFeatureFlag('hardcoded_regular_wait_time')
if (flagVal > 0) return formatDate(flagVal)
if (flagVal > 0) return formatDate(flagVal, getNrSubmittedDate(state))
if (flagVal < 0) return '-'

const statVal = getStats(state)?.regular_wait_time
if (statVal > 0) return formatDate(statVal)
if (statVal > 0) return formatDate(statVal, getNrSubmittedDate(state))
return '-'
}
}

Check failure on line 1368 in app/src/store/getters.ts

View workflow job for this annotation

GitHub Actions / namerequest-ci / linting-pnpm (24, 11.9.0)

Newline required at end of file but not found
Loading