Skip to content

Commit

Permalink
Fix/forget (#50)
Browse files Browse the repository at this point in the history
* Fix/wrong scheduled_days in forget

* 3.1.0-beta8
  • Loading branch information
ishiko732 authored Nov 19, 2023
1 parent 6e4352e commit 6db7188
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ts-fsrs",
"version": "3.1.0-beta7",
"version": "3.1.0-beta8",
"description": "ts-fsrs is a TypeScript package used to implement the Free Spaced Repetition Scheduler (FSRS) algorithm. It helps developers apply FSRS to their flashcard applications, thereby improving the user learning experience.",
"main": "dist/ts-fsrs.js",
"module": "dist/ts-fsrs.mjs",
Expand Down
2 changes: 1 addition & 1 deletion src/fsrs/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const default_w = [
];
export const default_enable_fuzz = false;

export const FSRSVersion: string = "3.1.0-beta7";
export const FSRSVersion: string = "3.1.0-beta8";

export const generatorParameters = (
props?: Partial<FSRSParameters>,
Expand Down
4 changes: 3 additions & 1 deletion src/fsrs/fsrs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ export class FSRS extends FSRSAlgorithm {
): RecordLogItem => {
card = this.preProcessCard(card);
now = this.preProcessDate(now);
const scheduled_days =
card.state === State.New ? 0 : now.diff(card.last_review as Date, "days");
const forget_log: ReviewLog = {
rating: Rating.Manual,
state: card.state,
Expand All @@ -154,7 +156,7 @@ export class FSRS extends FSRSAlgorithm {
difficulty: card.difficulty,
elapsed_days: 0,
last_elapsed_days: card.elapsed_days,
scheduled_days: card.scheduled_days,
scheduled_days: scheduled_days,
review: now,
};
const forget_card: Card = {
Expand Down

0 comments on commit 6db7188

Please sign in to comment.