Skip to content

Commit ad0e24f

Browse files
committed
refactor: remove UTC conversions
1 parent 825b92d commit ad0e24f

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

src/app/page.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { HydrationBoundary, dehydrate } from "@tanstack/react-query";
22
import dayjs from "dayjs";
3-
import utc from "dayjs/plugin/utc";
43

54
import { auth } from "auth";
65
import { DashboardPage } from "components/dashboard";
@@ -22,8 +21,6 @@ import { getQueryClient } from "lib/util";
2221

2322
import type { OrganizationsQueryVariables } from "generated/graphql";
2423

25-
dayjs.extend(utc);
26-
2724
export const dynamic = "force-dynamic";
2825

2926
/**
@@ -49,7 +46,7 @@ const HomePage = async () => {
4946
isMember: true,
5047
};
5148

52-
const oneWeekAgo = dayjs().utc().subtract(6, "days").startOf("day").toDate();
49+
const oneWeekAgo = dayjs().subtract(6, "days").startOf("day").toDate();
5350

5451
await Promise.all([
5552
queryClient.prefetchQuery({

src/components/dashboard/FeedbackOverview/FeedbackOverview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const FeedbackOverview = ({ oneWeekAgo }: Props) => {
4747
enabled: !!user?.rowId,
4848
select: (data) =>
4949
data?.posts?.groupedAggregates?.map((aggregate) => ({
50-
name: dayjs(aggregate.keys?.[0]).utc().format("ddd"),
50+
name: dayjs(aggregate.keys?.[0]).format("ddd"),
5151
total: Number(aggregate.distinctCount?.rowId),
5252
})),
5353
},
@@ -57,7 +57,7 @@ const FeedbackOverview = ({ oneWeekAgo }: Props) => {
5757
weeklyFeedback?.find((item) => item.name === date)?.total ?? 0;
5858

5959
const DATA = Array.from({ length: 7 }).map((_, index) => {
60-
const date = getFormattedDate(index + 1);
60+
const date = getFormattedDate(index);
6161

6262
return {
6363
name: date,

src/components/dashboard/Response/Response.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ interface Props extends FlexProps {
2222
* Recent feedback response.
2323
*/
2424
const Response = ({ feedback, ...rest }: Props) => {
25-
const date = dayjs(feedback?.createdAt).utc().fromNow();
25+
const date = dayjs(feedback?.createdAt).fromNow();
2626

2727
return (
2828
<Stack gap={4} w="100%" {...rest}>

src/components/layout/Layout/Layout.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { Center, Flex, Toaster, css, sigil } from "@omnidev/sigil";
44
import dayjs from "dayjs";
55
import duration from "dayjs/plugin/duration";
66
import relativeTime from "dayjs/plugin/relativeTime";
7-
import utc from "dayjs/plugin/utc";
87
import { useIsClient } from "usehooks-ts";
98

109
import { Footer, Header } from "components/layout";
@@ -15,7 +14,6 @@ import type { PropsWithChildren } from "react";
1514

1615
dayjs.extend(duration);
1716
dayjs.extend(relativeTime);
18-
dayjs.extend(utc);
1917

2018
/**
2119
* Core application layout.

0 commit comments

Comments
 (0)