Added more control over the stats appearing in the stats page
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user