--
This commit is contained in:
parent
b129058f3d
commit
fdf344fd3d
@ -54,12 +54,15 @@ export default function AvailablePrivilege() {
|
||||
if (created_at.length === 0) return 0
|
||||
const currentDate = moment()
|
||||
|
||||
return Number((moment(currentDate.add(amount, "days").diff(created_at)).unix() / 86400).toFixed(1))
|
||||
return Number((moment(moment(created_at).add(amount, "days").diff(currentDate)).unix() / 86400).toFixed(1))
|
||||
}
|
||||
const quizUnlimDays = getCramps(quizUnlimTime, userPrivileges?.quizUnlimTime?.created_at || "")
|
||||
const squizBadgeDays = getCramps(squizHideBadge, userPrivileges?.squizHideBadge?.created_at || "")
|
||||
|
||||
const currentDate = moment()
|
||||
console.log(quizUnlimDays)
|
||||
console.log(moment())
|
||||
console.log(moment(moment(userPrivileges?.quizUnlimTime?.created_at).add(quizUnlimTime, "days")))
|
||||
|
||||
return (
|
||||
<Box
|
||||
@ -83,7 +86,7 @@ export default function AvailablePrivilege() {
|
||||
quizUnlimDays > 0 && quizUnlimDays < 1 ?
|
||||
"последний день"
|
||||
:
|
||||
`${quizUnlimTime} ${declOfNum(Math.trunc(quizUnlimDays), DayForm)}`
|
||||
`${Math.trunc(quizUnlimDays)} ${declOfNum(Math.trunc(quizUnlimDays), DayForm)}`
|
||||
}
|
||||
</strong>
|
||||
</Typography>
|
||||
@ -100,7 +103,7 @@ export default function AvailablePrivilege() {
|
||||
squizBadgeDays > 0 && squizBadgeDays < 1 ?
|
||||
"последний день"
|
||||
:
|
||||
`${squizHideBadge} ${declOfNum(Math.trunc(squizBadgeDays), DayForm)}`
|
||||
`${Math.trunc(squizBadgeDays)} ${declOfNum(Math.trunc(squizBadgeDays), DayForm)}`
|
||||
}
|
||||
</strong>
|
||||
</Typography>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user