From 3e1ea509142db86fcf6d23a37a71bc2b44905fbc Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Thu, 9 Nov 2023 13:28:47 +1300 Subject: [PATCH] Format code --- InsightsPage.tsx | 1 + ViewGraph.tsx | 3 +++ 2 files changed, 4 insertions(+) diff --git a/InsightsPage.tsx b/InsightsPage.tsx index 94bf668..ee7b496 100644 --- a/InsightsPage.tsx +++ b/InsightsPage.tsx @@ -35,6 +35,7 @@ export default function InsightsPage() { if (period === Periods.TwoMonths) difference = "-2 months"; if (period === Periods.ThreeMonths) difference = "-3 months"; if (period === Periods.SixMonths) difference = "-6 months"; + const selectWeeks = ` SELECT strftime('%w', created) as week, COUNT(*) as count FROM sets diff --git a/ViewGraph.tsx b/ViewGraph.tsx index dcea542..a64fa45 100644 --- a/ViewGraph.tsx +++ b/ViewGraph.tsx @@ -28,8 +28,10 @@ export default function ViewGraph() { let difference = "-7 days"; if (period === Periods.Monthly) difference = "-1 months"; else if (period === Periods.Yearly) difference = "-1 years"; + let group = "%Y-%m-%d"; if (period === Periods.Yearly) group = "%Y-%m"; + const builder = setRepo .createQueryBuilder() .select("STRFTIME('%Y-%m-%d', created)", "created") @@ -41,6 +43,7 @@ export default function ViewGraph() { }) .groupBy("name") .addGroupBy(`STRFTIME('${group}', created)`); + switch (metric) { case Metrics.Best: builder