Skip to content

Commit

Permalink
Merge pull request #45 from hypersign-protocol/ui/fix
Browse files Browse the repository at this point in the history
fixed date and credit count issue
  • Loading branch information
varsha766 authored Jan 31, 2025
2 parents cdd419a + 0d0c00a commit 6353925
Showing 1 changed file with 15 additions and 20 deletions.
35 changes: 15 additions & 20 deletions src/views/playground/KYCDashboardCredit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,6 @@ h5 span {
<!-- <td>
{{ numberFormat(eachRow.used) }}
</td> -->




<td v-if="eachRow.used >= eachRow.totalCredits" class="greyFont">
Credit Limit Reached

Expand All @@ -238,9 +234,8 @@ h5 span {
Expired
</td>
<td v-else>
{{ formatTimeRemaining(eachRow.expiresAt) }}
{{ isValidDate(eachRow.expiresAt) ? formatTimeRemaining(eachRow.expiresAt) : 'Not Activated' }}
</td>



<td :title="`Credit left: ${eachRow.totalCredits - eachRow.used}`" >
Expand Down Expand Up @@ -312,27 +307,23 @@ export default {
}
}
// const now = new Date()
const now = new Date()
let not_expired_credits = this.getKYCCredits.filter(x => {
// if (x.expiresAt) {
// const expirydate = new Date(x.expiresAt)
if (x.expiresAt) {
const expirydate = new Date(x.expiresAt)
if ((expirydate >= now) && (x.used < x.totalCredits)) {
// if ((expirydate >= now) && (x.used < x.totalCredits)) {
// return x
// }
// } else if (x.status == 'Active') {
// return x
// }
return x
}
} else if (x.status == 'Active') {
return x
}else if(!x.expiresAt)
return x
})
if (not_expired_credits.length == 0) {
return {
allAvailableCredits: 0,
Expand Down Expand Up @@ -489,8 +480,12 @@ export default {
}
}
},
isValidDate(date) {
const parsedDate = new Date(date);
return !isNaN(parsedDate.getTime());
},
},
mixins: [UtilsMixin],
Expand Down

0 comments on commit 6353925

Please sign in to comment.