Skip to content

Commit 0b60ca4

Browse files
authored
Merge pull request #373 from autonomys/fix-renewal-date
fix(frontend): renewal date relative time calculation
2 parents 0e70dd8 + 49b73c8 commit 0b60ca4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

frontend/src/components/Navbar/SideNavbar.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
import React, { useMemo } from 'react';
1313
import { RoleProtected } from 'components/RoleProtected';
1414
import { UserRole } from '@auto-drive/models';
15+
import dayjs from 'dayjs';
1516
import { AccountInformation } from '@/components/AccountInformation';
1617
import { useUserStore } from 'globalStates/user';
1718
import { usePathname } from 'next/navigation';
@@ -65,8 +66,8 @@ export const SideNavbar = ({ networkId }: SideNavbarProps) => {
6566
const subscription = useUserStore(({ subscription }) => subscription);
6667

6768
const renewalDate = useMemo(() => {
68-
const date = new Date();
69-
return new Date(date.getFullYear(), date.getMonth() + 1, 0);
69+
const date = dayjs().add(1, 'month').startOf('month');
70+
return date.toDate();
7071
}, []);
7172

7273
return (

0 commit comments

Comments
 (0)