mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 12:47:11 -05:00
Implement last_interval_secs function
This commit is contained in:
parent
d8161daf9e
commit
193d6bdf11
1 changed files with 9 additions and 0 deletions
|
|
@ -85,6 +85,15 @@ impl RevlogEntry {
|
|||
.unwrap()
|
||||
}
|
||||
|
||||
pub(crate) fn last_interval_secs(&self) -> u32 {
|
||||
u32::try_from(if self.last_interval > 0 {
|
||||
self.last_interval.saturating_mul(86_400)
|
||||
} else {
|
||||
self.last_interval.saturating_mul(-1)
|
||||
})
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
/// Returns true if this entry represents a reset operation.
|
||||
/// These entries are created when a card is reset using
|
||||
/// [`Collection::reschedule_cards_as_new`].
|
||||
|
|
|
|||
Loading…
Reference in a new issue