Created
May 15, 2017 12:57
-
-
Save Akendo/a628420579d1c4baa174605e56de114b to your computer and use it in GitHub Desktop.
review.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tasklib.task | |
# https://tasklib.readthedocs.io/en/latest/#dealing-with-dates-and-time | |
from datetime import datetime, date, timedelta | |
tw = tasklib.TaskWarrior("/home/akendo/.task") | |
ldone_tasks = tw.tasks.filter(status='Completed') | |
#ldone_tasks[-1]['end'] | |
#date.today() - timedelta(days=7) | |
# Create an object of timedelta that can be used to subtrack from the currentdate = now - 7d in taskw. | |
last_review = datetime.today() - timedelta(days=7) | |
# https://docs.python.org/2/library/datetime.html#datetime-objects | |
#[(last_review.astimezone() < ldone_tasks[n]['end'],ldone_tasks[n]) for n in range(len(ldone_tasks))] | |
for n in range(len(ldone_tasks)): | |
if last_review.astimezone() < ldone_tasks[n]['end']: | |
print(ldone_tasks[n]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment