diff --git a/app/Utils/StatsUtils.ts b/app/Utils/StatsUtils.ts index 9d7a2e2..9765efa 100644 --- a/app/Utils/StatsUtils.ts +++ b/app/Utils/StatsUtils.ts @@ -3,12 +3,12 @@ import CommandsRun from "App/Models/CommandsRun"; import BuildsRun from "App/Models/BuildsRun"; interface Stats { - start: Date; - end: Date; + start: Date + end: Date - development_seconds: number; - commands_ran: number; - builds_ran: number; + development_seconds: number + commands_ran: number + builds_ran: number } export async function getDevelopmentHours(start: Date, end: Date): Promise { @@ -57,8 +57,8 @@ export async function getBuildsRan(start: Date, end: Date): Promise { } export async function fetchStatistics(): Promise { - const start = new Date("01-01-2000"); - const end = new Date(); + const start = new Date("01-01-2000") + const end = new Date() const development_seconds = await getDevelopmentHours(start, end) const commands_ran = await getCommandsRan(start, end) @@ -74,8 +74,8 @@ export async function fetchStatistics(): Promise { } export async function fetchMonthlyStatistics(): Promise { - const start = new Date(new Date().setMonth(new Date().getMonth() - 1)); - const end = new Date(); + const start = new Date(new Date().setMonth(new Date().getMonth() - 1)) + const end = new Date() const development_seconds = await getDevelopmentHours(start, end) const commands_ran = await getCommandsRan(start, end) @@ -91,8 +91,8 @@ export async function fetchMonthlyStatistics(): Promise { } export async function fetchWeeklyStatistics(): Promise { - const start = new Date(new Date().getTime() - 7 * 24 * 60 * 60 * 1000); - const end = new Date(); + const start = new Date(new Date().getTime() - 7 * 24 * 60 * 60 * 1000) + const end = new Date() const development_seconds = await getDevelopmentHours(start, end) const commands_ran = await getCommandsRan(start, end) @@ -108,8 +108,8 @@ export async function fetchWeeklyStatistics(): Promise { } export async function fetchDailyStatistics(): Promise { - const start = new Date(); - const end = new Date(); + const start = new Date() + const end = new Date() const development_seconds = await getDevelopmentHours(start, end) const commands_ran = await getCommandsRan(start, end)