File tree Expand file tree Collapse file tree
components/existing-request Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " name-request" ,
3- "version" : " 5.9.0 " ,
3+ "version" : " 5.9.1 " ,
44 "private" : true ,
55 "engines" : {
66 "node" : " >=24"
Original file line number Diff line number Diff line change 200200 v-bind =" attrs"
201201 class =" dotted-underline app-blue font-weight-regular cursor-default"
202202 v-on =" on"
203- >{{ getRegularWaitTime }}</span >
203+ >{{ getRegularEstimateReviewDate }}</span >
204204 </template >
205205 This is an estimate only, actual review date may vary. Staff are
206- currently reviewing Name Requests submitted on {{ getRegularWaitTime }}.
206+ currently reviewing Name Requests submitted on {{ getRegularEstimateReviewDate.split(" (")[0] }}.
207207 </v-tooltip >
208208 </v-col >
209209
@@ -369,6 +369,7 @@ export default class ExistingRequestDisplay extends Mixins(
369369 @Getter (useStore ) getNrId! : number
370370 @Getter (useStore ) getNrState! : NrState
371371 @Getter (useStore ) getRegularWaitTime! : string | number
372+ @Getter (useStore ) getRegularEstimateReviewDate! : string
372373 @Getter (useStore ) isMobile! : boolean
373374
374375 @Action (useStore ) editExistingRequest! : ActionBindingIF
Original file line number Diff line number Diff line change @@ -1332,3 +1332,30 @@ export const getRegularWaitTime = (state: StateIF): string | number => {
13321332 if ( statVal > 0 ) return statVal
13331333 return '-'
13341334}
1335+
1336+ function formatDate ( statVal : number ) : string {
1337+ const today = new Date ( ) ;
1338+ const result = new Date ( today ) ;
1339+
1340+ result . setDate ( today . getDate ( ) + statVal ) ;
1341+ const formatted = result . toLocaleDateString ( 'en-CA' , {
1342+ year : 'numeric' ,
1343+ month : 'long' ,
1344+ day : 'numeric'
1345+ } ) ;
1346+ if ( statVal > 1 ) {
1347+ return formatted + " (" + statVal + " days)"
1348+ } else {
1349+ return formatted + " (" + statVal + " day)"
1350+ }
1351+ }
1352+
1353+ export const getRegularEstimateReviewDate = ( state : StateIF ) : string => {
1354+ const flagVal = GetFeatureFlag ( 'hardcoded_regular_wait_time' )
1355+ if ( flagVal > 0 ) return formatDate ( flagVal )
1356+ if ( flagVal < 0 ) return '-'
1357+
1358+ const statVal = getStats ( state ) ?. regular_wait_time
1359+ if ( statVal > 0 ) return formatDate ( statVal )
1360+ return '-'
1361+ }
You can’t perform that action at this time.
0 commit comments