Skip to content

Commit b9a982d

Browse files
committed
fix calculation
1 parent 0e0f61b commit b9a982d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/lib/stores/billing.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,10 @@ export function calculateEnterpriseTrial(org: Organization) {
291291
const today = new Date();
292292

293293
let diffCycle = endDate.getTime() - startDate.getTime();
294-
diffCycle = Math.ceil(diffCycle / (1000 * 60 * 60 * 24)) + 1;
295-
if (diffCycle === 15) {
294+
diffCycle = Math.ceil(diffCycle / (1000 * 60 * 60 * 24));
295+
if (diffCycle === 14) {
296296
const remaining = endDate.getTime() - today.getTime();
297-
return Math.ceil(remaining / (1000 * 60 * 60 * 24)) + 1;
297+
return Math.ceil(remaining / (1000 * 60 * 60 * 24));
298298
}
299299
return 0;
300300
}

src/routes/(console)/organization-[organization]/enterpriseTrial.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
Your enterprise trial expires in <Badge
2828
size="xs"
2929
variant="secondary"
30-
content={remainingDays.toString()} /> days.
30+
content={remainingDays.toString()} /> days
3131
</Typography.Text>
3232

3333
<Button size="xs" secondary fullWidthMobile href={upgradeUrl}>Upgrade</Button>

0 commit comments

Comments
 (0)