mirror of
https://github.com/ankitects/anki.git
synced 2026-01-13 14:03:55 -05:00
Limit study time to hours in reviews graph
Relevant discussions: - https://forums.ankiweb.net/t/reviews-graph-units-of-total-time-studied-suggestion/61237 - https://forums.ankiweb.net/t/why-does-anki-display-study-time-in-months/37722 - https://forums.ankiweb.net/t/poll-use-hours-in-total-time-stats/62076 - https://github.com/ankitects/anki/pull/3901#issuecomment-2973161601
This commit is contained in:
parent
0a3adf02b0
commit
cb3c3cdc2d
1 changed files with 4 additions and 4 deletions
|
|
@ -8,7 +8,7 @@
|
|||
import type { GraphsResponse } from "@generated/anki/stats_pb";
|
||||
import * as tr from "@generated/ftl";
|
||||
import { localizedNumber } from "@tslib/i18n";
|
||||
import { dayLabel, timeSpan } from "@tslib/time";
|
||||
import { dayLabel, timeSpan, TimespanUnit } from "@tslib/time";
|
||||
import type { Bin, ScaleSequential } from "d3";
|
||||
import {
|
||||
area,
|
||||
|
|
@ -141,7 +141,7 @@ export function renderReviews(
|
|||
|
||||
const yTickFormat = (n: number): string => {
|
||||
if (showTime) {
|
||||
return timeSpan(n / 1000, true);
|
||||
return timeSpan(n / 1000, true, false, TimespanUnit.Hours);
|
||||
} else {
|
||||
if (Math.round(n) != n) {
|
||||
return "";
|
||||
|
|
@ -205,7 +205,7 @@ export function renderReviews(
|
|||
|
||||
function valueLabel(n: number): string {
|
||||
if (showTime) {
|
||||
return timeSpan(n / 1000);
|
||||
return timeSpan(n / 1000, false, true, TimespanUnit.Hours);
|
||||
} else {
|
||||
return tr.statisticsReviews({ reviews: n });
|
||||
}
|
||||
|
|
@ -340,7 +340,7 @@ export function renderReviews(
|
|||
averageAnswerTime: string,
|
||||
averageAnswerTimeLabel: string;
|
||||
if (showTime) {
|
||||
totalString = timeSpan(total / 1000, false);
|
||||
totalString = timeSpan(total / 1000, false, true, TimespanUnit.Hours);
|
||||
averageForDaysStudied = tr.statisticsMinutesPerDay({
|
||||
count: Math.round(studiedAvg / 1000 / 60),
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue