Skip to content

Commit

Permalink
[GSW-546] fix: Fix comment merge request
Browse files Browse the repository at this point in the history
  • Loading branch information
khiemldk committed Dec 14, 2023
1 parent 22d6a74 commit ef6ed6f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 21 deletions.
18 changes: 0 additions & 18 deletions packages/web/src/common/utils/date-util.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { IPrices1d } from "@repositories/token";
import dayjs from "dayjs";

const getDateUtcToLocal = (d: any) => {
Expand Down Expand Up @@ -42,23 +41,6 @@ export const getLocalDateString = (d: any) => {
return `${value} (${offsetHoursString})`;
};

export function generateRandomPoints(start: Date, end: Date, count: number): IPrices1d[] {
const timeDifference = end.getTime() - start.getTime();
const interval = timeDifference / (count + 1);

const randomPoints: IPrices1d[] = [];

for (let i = 1; i <= count - 2; i++) {
const randomTime = start.getTime() + i * interval;
const randomDate = new Date(randomTime);
const randomPrice = Math.random().toFixed(6);

randomPoints.push({ date: randomDate.toISOString(), price: randomPrice });
}

return randomPoints;
}

export function formatTime(date: Date): string {
const hours = String(date.getHours()).padStart(2, "0");
const minutes = String(date.getMinutes()).padStart(2, "0");
Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/components/common/line-graph/LineGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ function parseTimeTVL(time: string) {
const formattedHours = hours % 12 || 12;
if (!month || !day || !year)
return {
date: "Jan 01, 2023",
time: "00:00 AM"
date: "",
time: ""
};
return {
date: `${month} ${day}, ${year}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { useAtom } from "jotai";
import { TokenState } from "@states/index";
import { useTokenTradingModal } from "@hooks/swap/use-token-trading-modal";
import { useClearModal } from "@hooks/common/use-clear-modal";
// import { generateRandomPoints } from "@common/utils/date-util";
import useComponentSize from "@hooks/common/use-component-size";
import { useWindowSize } from "@hooks/common/use-window-size";
import { DEVICE_TYPE } from "@styles/media";
Expand Down

0 comments on commit ef6ed6f

Please sign in to comment.