File tree Expand file tree Collapse file tree 1 file changed +15
-20
lines changed Expand file tree Collapse file tree 1 file changed +15
-20
lines changed Original file line number Diff line number Diff line change @@ -226,10 +226,6 @@ h5 span {
226
226
<!-- <td>
227
227
{{ numberFormat(eachRow.used) }}
228
228
</td> -->
229
-
230
-
231
-
232
-
233
229
<td v-if =" eachRow.used >= eachRow.totalCredits" class =" greyFont" >
234
230
Credit Limit Reached
235
231
@@ -238,9 +234,8 @@ h5 span {
238
234
Expired
239
235
</td >
240
236
<td v-else >
241
- {{ formatTimeRemaining(eachRow.expiresAt) }}
237
+ {{ isValidDate(eachRow.expiresAt) ? formatTimeRemaining(eachRow.expiresAt) : 'Not Activated' }}
242
238
</td >
243
-
244
239
245
240
246
241
<td :title =" `Credit left: ${eachRow.totalCredits - eachRow.used}`" >
@@ -312,27 +307,23 @@ export default {
312
307
}
313
308
}
314
309
315
- // const now = new Date()
310
+ const now = new Date ()
316
311
let not_expired_credits = this .getKYCCredits .filter (x => {
317
312
318
- // if (x.expiresAt) {
319
- // const expirydate = new Date(x.expiresAt)
320
-
313
+ if (x .expiresAt ) {
314
+ const expirydate = new Date (x .expiresAt )
321
315
316
+ if ((expirydate >= now) && (x .used < x .totalCredits )) {
322
317
323
- // if ((expirydate >= now) && (x.used < x.totalCredits)) {
324
-
325
- // return x
326
- // }
327
- // } else if (x.status == 'Active') {
328
- // return x
329
- // }
318
+ return x
319
+ }
320
+ } else if (x .status == ' Active' ) {
321
+ return x
322
+ }else if (! x .expiresAt )
330
323
return x
331
-
332
324
})
333
325
334
326
335
-
336
327
if (not_expired_credits .length == 0 ) {
337
328
return {
338
329
allAvailableCredits: 0 ,
@@ -489,8 +480,12 @@ export default {
489
480
}
490
481
491
482
492
- }
483
+ },
493
484
485
+ isValidDate (date ) {
486
+ const parsedDate = new Date (date);
487
+ return ! isNaN (parsedDate .getTime ());
488
+ },
494
489
},
495
490
mixins: [UtilsMixin],
496
491
You can’t perform that action at this time.
0 commit comments