Added more control over the stats appearing in the stats page

This commit is contained in:
Tiago Ribeiro
2023-12-18 22:42:14 +00:00
parent c37bb2691b
commit 438778a03c
3 changed files with 225 additions and 128 deletions

View File

@@ -4,6 +4,11 @@ import {convertCamelCaseToReadable} from "@/utils/string";
import {UserSolution} from "@/interfaces/exam";
import {Module} from "@/interfaces";
import {MODULES} from "@/constants/ielts";
import moment from "moment";
export const timestampToMoment = (stat: Stat): moment.Moment => {
return moment.unix(stat.date > Math.pow(10, 11) ? stat.date / 1000 : stat.date);
};
export const totalExams = (stats: Stat[]): number => {
const moduleStats = formatModuleTotalStats(stats);