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.ThreeMonths) difference = "-3 months";
|
||||
if (period === Periods.SixMonths) difference = "-6 months";
|
||||
|
||||
const selectWeeks = `
|
||||
SELECT strftime('%w', created) as week, COUNT(*) as count
|
||||
FROM sets
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user