Use date, not datetime, to dermine how long ago track was last played.
Fixes #92.
This commit is contained in:
parent
88b2789128
commit
bf2ef70595
@ -25,7 +25,7 @@ def get_relative_date(past_date, reference_date=None):
|
|||||||
if past_date > reference_date:
|
if past_date > reference_date:
|
||||||
return "get_relative_date() past_date is after relative_date"
|
return "get_relative_date() past_date is after relative_date"
|
||||||
|
|
||||||
weeks, days = divmod((reference_date - past_date).days, 7)
|
weeks, days = divmod((reference_date.date() - past_date.date()).days, 7)
|
||||||
if weeks == days == 0:
|
if weeks == days == 0:
|
||||||
# Played today, so return time instead
|
# Played today, so return time instead
|
||||||
return past_date.strftime("%H:%M")
|
return past_date.strftime("%H:%M")
|
||||||
|
|||||||
@ -1,44 +0,0 @@
|
|||||||
alembic==1.5.7
|
|
||||||
backcall==0.2.0
|
|
||||||
decorator==5.0.7
|
|
||||||
flake8==3.9.1
|
|
||||||
greenlet==1.0.0
|
|
||||||
importlib-metadata==3.7.3
|
|
||||||
ipdb==0.13.7
|
|
||||||
ipython==7.22.0
|
|
||||||
ipython-genutils==0.2.0
|
|
||||||
jedi==0.18.0
|
|
||||||
Mako==1.1.4
|
|
||||||
MarkupSafe==1.1.1
|
|
||||||
mccabe==0.6.1
|
|
||||||
mutagen==1.45.1
|
|
||||||
mysqlclient==2.0.3
|
|
||||||
parso==0.8.2
|
|
||||||
pexpect==4.8.0
|
|
||||||
pickleshare==0.7.5
|
|
||||||
prompt-toolkit==3.0.18
|
|
||||||
psutil==5.8.0
|
|
||||||
ptyprocess==0.7.0
|
|
||||||
pycodestyle==2.7.0
|
|
||||||
pydub==0.25.1
|
|
||||||
pyflakes==2.3.1
|
|
||||||
Pygments==2.8.1
|
|
||||||
PyQt5==5.15.4
|
|
||||||
PyQt5-Qt5==5.15.2
|
|
||||||
PyQt5-sip==12.8.1
|
|
||||||
PyQtWebEngine==5.15.4
|
|
||||||
PyQtWebEngine-Qt5==5.15.2
|
|
||||||
python-dateutil==2.8.1
|
|
||||||
python-editor==1.0.4
|
|
||||||
python-slugify==5.0.0
|
|
||||||
python-vlc==3.0.11115
|
|
||||||
six==1.15.0
|
|
||||||
slugify==0.0.1
|
|
||||||
SQLAlchemy==1.4.2
|
|
||||||
text-unidecode==1.3
|
|
||||||
tinytag==1.5.0
|
|
||||||
toml==0.10.2
|
|
||||||
traitlets==5.0.5
|
|
||||||
typing-extensions==3.7.4.3
|
|
||||||
wcwidth==0.2.5
|
|
||||||
zipp==3.4.1
|
|
||||||
Loading…
Reference in New Issue
Block a user