From 57d6d64ad326052a2c77a2f5f1efa535de27e1f4 Mon Sep 17 00:00:00 2001 From: Alexander Pletnev Date: Fri, 2 Oct 2015 23:31:00 +0300 Subject: [PATCH] Add Statistic plugin (#1581 Amount of hours spent on a book) check for NaN in case when nothing read yet --- plugins/statistics.koplugin/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/statistics.koplugin/main.lua b/plugins/statistics.koplugin/main.lua index 92a174ee9..a654dde63 100755 --- a/plugins/statistics.koplugin/main.lua +++ b/plugins/statistics.koplugin/main.lua @@ -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));