Fix/last date of existing card should not be positive in simulation (#3667)

* Fix/last date of existing card should not be positive in simulation

* update fsrs-rs to v1.4.9

* ./ninja fix:minilints
This commit is contained in:
Jarrett Ye 2025-01-08 20:05:37 +08:00 committed by GitHub
parent aaf8b4dddb
commit 39bf29e1a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -75,10 +75,11 @@ impl Card {
CardQueue::DayLearn | CardQueue::Review => {
let due = card.original_or_current_due();
let relative_due = due - days_elapsed;
let last_date = (relative_due - card.interval as i32).min(0) as f32;
Some(fsrs::Card {
difficulty: state.difficulty,
stability: state.stability,
last_date: (relative_due - card.interval as i32) as f32,
last_date,
due: relative_due as f32,
})
}