mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Show last downloaded date for news in human readable form
This commit is contained in:
parent
e2a2701e23
commit
38925cc86c
@ -350,9 +350,11 @@ class SchedulerDialog(QDialog, Ui_Dialog):
|
||||
self.username.blockSignals(False)
|
||||
self.password.blockSignals(False)
|
||||
d = datetime.utcnow() - recipe.last_downloaded
|
||||
ld = '%.2f'%(d.days + d.seconds/(24.*3600))
|
||||
def hm(x): return (x-x%3600)//3600, (x%3600 - (x%3600)%60)//60
|
||||
hours, minutes = hm(d.seconds)
|
||||
tm = _('%d days, %d hours and %d minutes ago')%(d.days, hours, minutes)
|
||||
if d < timedelta(days=366):
|
||||
self.last_downloaded.setText(_('Last downloaded: %s days ago')%ld)
|
||||
self.last_downloaded.setText(_('Last downloaded')+': '+tm)
|
||||
else:
|
||||
self.last_downloaded.setText(_('Last downloaded: never'))
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>726</width>
|
||||
<width>738</width>
|
||||
<height>575</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -194,6 +194,9 @@
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user