mirror of
https://github.com/ankitects/anki.git
synced 2026-01-13 14:03:55 -05:00
Use the new approach for native stability in Card Info
This commit is contained in:
parent
cb3c3cdc2d
commit
950f26c16b
1 changed files with 7 additions and 2 deletions
|
|
@ -5,7 +5,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
<script lang="ts">
|
||||
import type { CardStatsResponse } from "@generated/anki/stats_pb";
|
||||
import * as tr2 from "@generated/ftl";
|
||||
import { DAY, timeSpan, Timestamp } from "@tslib/time";
|
||||
import { DAY, timeSpan, TimespanUnit, Timestamp } from "@tslib/time";
|
||||
|
||||
export let stats: CardStatsResponse;
|
||||
|
||||
|
|
@ -58,7 +58,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
if (stats.memoryState) {
|
||||
let stability = timeSpan(stats.memoryState.stability * 86400, false, false);
|
||||
if (stats.memoryState.stability > 31) {
|
||||
const nativeStability = stats.memoryState.stability.toFixed(0);
|
||||
const nativeStability = timeSpan(
|
||||
stats.memoryState.stability * 86400,
|
||||
false,
|
||||
false,
|
||||
TimespanUnit.Days,
|
||||
);
|
||||
stability += ` (${nativeStability})`;
|
||||
}
|
||||
statsRows.push({
|
||||
|
|
|
|||
Loading…
Reference in a new issue