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:
Alexander Pletnev
2015-10-02 23:31:00 +03:00
parent 24a4830bcc
commit 57d6d64ad3

View File

@@ -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));