Format code

This commit is contained in:
Brandon Presley 2023-11-09 13:28:47 +13:00
parent e5db6fe34b
commit 3e1ea50914
2 changed files with 4 additions and 0 deletions

View File

@ -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

View File

@ -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