Skip to content

Commit

Permalink
Fix/now date (#32)
Browse files Browse the repository at this point in the history
* Fix/wrong date

* 3.0.1
  • Loading branch information
ishiko732 authored Oct 15, 2023
1 parent d05c20e commit 9d8b9ce
Show file tree
Hide file tree
Showing 3 changed files with 3 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.0.0",
"version": "3.0.1",
"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/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/fsrs/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const default_w = envParams.FSRS_W || [
];
export const default_enable_fuzz = envParams.FSRS_ENABLE_FUZZ || false;

export const FSRSVersion: string = "3.0.0";
export const FSRSVersion: string = "3.0.1";

export const generatorParameters = (props?: Partial<FSRSParameters>) => {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/fsrs/fsrs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class FSRS {
...card,
last_review: card.last_review ? fixDate(card.last_review) : undefined,
};
now = new Date(fixDate(now));
now = fixDate(now);
card.elapsed_days =
card.state === State.New ? 0 : now.diff(card.last_review as Date, "days"); //相距时间
card.last_review = now; // 上次复习时间
Expand Down

0 comments on commit 9d8b9ce

Please sign in to comment.