Skip to content

Commit

Permalink
Change limit in leaderboard
Browse files Browse the repository at this point in the history
  • Loading branch information
anhnhu committed Jun 14, 2024
1 parent 843512b commit fea7bc2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const Component = ({ className }: Props): React.ReactElement => {
let karuraBoardSub: { unsubscribe: () => void } | null = null;

if (selectedTab === TabType.KARURA_PLAYDROP) {
karuraBoardSub = apiSDK.subscribeLeaderboard(start, end, 0, 1500).subscribe((data) => {
karuraBoardSub = apiSDK.subscribeLeaderboard(start, end, 0, 100).subscribe((data) => {
setLeaderBoard(data);
});
} else {
Expand Down
13 changes: 12 additions & 1 deletion packages/extension-koni-ui/src/utils/date/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ export const formatDateFully = (date: Date) => {
return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
};

const formatFully = (date: Date) => {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // Tháng bắt đầu từ 0
const day = String(date.getDate()).padStart(2, '0');
const hour = String(date.getHours()).padStart(2, '0');
const minute = String(date.getMinutes()).padStart(2, '0');
const second = String(date.getSeconds()).padStart(2, '0');

return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
};

export function calculateStartAndEnd (key: string) {
const today = new Date();
const year = today.getUTCFullYear();
Expand All @@ -40,7 +51,7 @@ export function calculateStartAndEnd (key: string) {
const startDate = new Date(startEnv);
const endDate = new Date(endEnv);

return { start: formatDateFully(startDate), end: formatDateFully(endDate) };
return { start: formatFully(startDate), end: formatFully(endDate) };
}

default:
Expand Down

0 comments on commit fea7bc2

Please sign in to comment.