dates.py 352 B

12345678910111213
  1. from datetime import timedelta
  2. from django.conf import settings
  3. from django.utils import timezone
  4. def is_date_tracked(date, user, category_read_cutoff=None):
  5. if date:
  6. if category_read_cutoff and category_read_cutoff > date:
  7. return False
  8. else:
  9. return date > user.reads_cutoff
  10. else:
  11. return False