Format code
This commit is contained in:
parent
e5db6fe34b
commit
3e1ea50914
|
@ -35,6 +35,7 @@ export default function InsightsPage() {
|
||||||
if (period === Periods.TwoMonths) difference = "-2 months";
|
if (period === Periods.TwoMonths) difference = "-2 months";
|
||||||
if (period === Periods.ThreeMonths) difference = "-3 months";
|
if (period === Periods.ThreeMonths) difference = "-3 months";
|
||||||
if (period === Periods.SixMonths) difference = "-6 months";
|
if (period === Periods.SixMonths) difference = "-6 months";
|
||||||
|
|
||||||
const selectWeeks = `
|
const selectWeeks = `
|
||||||
SELECT strftime('%w', created) as week, COUNT(*) as count
|
SELECT strftime('%w', created) as week, COUNT(*) as count
|
||||||
FROM sets
|
FROM sets
|
||||||
|
|
|
@ -28,8 +28,10 @@ export default function ViewGraph() {
|
||||||
let difference = "-7 days";
|
let difference = "-7 days";
|
||||||
if (period === Periods.Monthly) difference = "-1 months";
|
if (period === Periods.Monthly) difference = "-1 months";
|
||||||
else if (period === Periods.Yearly) difference = "-1 years";
|
else if (period === Periods.Yearly) difference = "-1 years";
|
||||||
|
|
||||||
let group = "%Y-%m-%d";
|
let group = "%Y-%m-%d";
|
||||||
if (period === Periods.Yearly) group = "%Y-%m";
|
if (period === Periods.Yearly) group = "%Y-%m";
|
||||||
|
|
||||||
const builder = setRepo
|
const builder = setRepo
|
||||||
.createQueryBuilder()
|
.createQueryBuilder()
|
||||||
.select("STRFTIME('%Y-%m-%d', created)", "created")
|
.select("STRFTIME('%Y-%m-%d', created)", "created")
|
||||||
|
@ -41,6 +43,7 @@ export default function ViewGraph() {
|
||||||
})
|
})
|
||||||
.groupBy("name")
|
.groupBy("name")
|
||||||
.addGroupBy(`STRFTIME('${group}', created)`);
|
.addGroupBy(`STRFTIME('${group}', created)`);
|
||||||
|
|
||||||
switch (metric) {
|
switch (metric) {
|
||||||
case Metrics.Best:
|
case Metrics.Best:
|
||||||
builder
|
builder
|
||||||
|
|
Loading…
Reference in New Issue
Block a user