mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Vocabulary builder: allow longer intervals (#9764)
This commit is contained in:
@@ -227,7 +227,7 @@ function VocabularyBuilder:gotOrForgot(item, isGot)
|
||||
elseif target_count == 7 then
|
||||
due_time = current_time + 24 * 15 * 3600
|
||||
else
|
||||
due_time = current_time + 24 * 30 * 3600
|
||||
due_time = current_time + 24 * 3600 * 30 * 2 ^ (math.min(target_count - 8, 6))
|
||||
end
|
||||
|
||||
item.last_streak_count = item.streak_count
|
||||
|
||||
@@ -932,13 +932,17 @@ function VocabItemWidget:getTimeSinceDue()
|
||||
|
||||
local rounding = elapsed > 0 and math.floor or math.ceil
|
||||
if abs < 60 then
|
||||
readable_time = abs .. C_("Time", "s")
|
||||
readable_time = T(C_("Time", "%1s"), abs)
|
||||
elseif abs < 3600 then
|
||||
readable_time = string.format("%d"..C_("Time", "m"), rounding(abs/60))
|
||||
readable_time = T(C_("Time", "%1m"), rounding(abs/60))
|
||||
elseif abs < 3600 * 24 then
|
||||
readable_time = string.format("%d"..C_("Time", "h"), rounding(abs/3600))
|
||||
readable_time = T(C_("Time", "%1h"), rounding(abs/3600))
|
||||
elseif abs < 3600 * 24 * 30 then
|
||||
readable_time = T(C_("Time", "%1d"), rounding(abs/3600/24))
|
||||
elseif abs < 3600 * 24 * 365 then
|
||||
readable_time = T(C_("Time", "%1 mo."), rounding(abs/3600/24/3)/10)
|
||||
else
|
||||
readable_time = string.format("%d"..C_("Time", "d"), rounding(abs/3600/24))
|
||||
readable_time = T(C_("Time", "%1 yr."), rounding(abs/3600/24/36.5)/10)
|
||||
end
|
||||
|
||||
if elapsed < 0 then
|
||||
|
||||
Reference in New Issue
Block a user