mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
Add Statistic plugin (#1581 Amount of hours spent on a book)
check for NaN in case when nothing read yet
This commit is contained in:
@@ -309,7 +309,7 @@ end
|
||||
--https://gist.github.com/jesseadams/791673
|
||||
function ReaderStatistics:secondsToClock(seconds)
|
||||
local seconds = tonumber(seconds)
|
||||
if seconds == 0 then
|
||||
if seconds == 0 or seconds ~= seconds then
|
||||
return "00:00:00";
|
||||
else
|
||||
local hours = string.format("%02.f", math.floor(seconds / 3600));
|
||||
|
||||
Reference in New Issue
Block a user