🎨 Show card NextDue to the flashcard management UI https://github.com/siyuan-note/siyuan/pull/9621

This commit is contained in:
Daniel 2023-11-16 22:49:59 +08:00
parent 04bb9642f3
commit cb45da4319
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 8 additions and 3 deletions

View file

@ -70,9 +70,14 @@ type RiffCard struct {
Reps uint64 `json:"reps"` Reps uint64 `json:"reps"`
} }
func GetRiffCard(card *fsrs.Card) *RiffCard { func getRiffCard(card *fsrs.Card) *RiffCard {
due := card.Due
if due.IsZero() {
due = time.Now()
}
return &RiffCard{ return &RiffCard{
Due: card.Due, Due: due,
Reps: card.Reps, Reps: card.Reps,
} }
} }

View file

@ -334,7 +334,7 @@ func getCardsBlocks(cards []riff.Card, page int) (blocks []*Block, total, pageCo
} }
b.RiffCardID = cards[i].ID() b.RiffCardID = cards[i].ID()
b.RiffCard = GetRiffCard(cards[i].(*riff.FSRSCard).C) b.RiffCard = getRiffCard(cards[i].(*riff.FSRSCard).C)
} }
return return
} }