mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix formatter function days_between to compute the right value when the answer is negative.
This commit is contained in:
parent
9038754c71
commit
6afd231a14
@ -1187,7 +1187,7 @@ class BuiltinDaysBetween(BuiltinFormatterFunction):
|
||||
except:
|
||||
return ''
|
||||
i = d1 - d2
|
||||
return str('%d.%d'%(i.days, i.seconds/8640))
|
||||
return '%.1f'%(i.days + (i.seconds/(24.0*60.0*60.0)))
|
||||
|
||||
class BuiltinLanguageStrings(BuiltinFormatterFunction):
|
||||
name = 'language_strings'
|
||||
|
Loading…
x
Reference in New Issue
Block a user