Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Archives and Calendar display incorrectly with TZ aware app #222

Closed
SteveByerly opened this Issue March 25, 2013 · 1 comment

2 participants

SteveByerly Julien Fache
SteveByerly

If you enable USE_TZ in your settings, the archives and calendar (at the least) do not display the entries correctly when using the regroup template tag.

Example case:

  • An entry uploaded at 12 PM on 2-28.
  • An entry uploaded at 1 AM on 3-1.
  • One or more entries uploaded after 3-1

The archives in the sidebar would display:

  • February
    • February 28
  • February
    • February 28
    • March x
    • March x
Julien Fache Fantomas42 closed this April 04, 2013
Julien Fache
Owner

Hi Steve,

your reported issue is very interesting and your pull request too.

I have made some search on this and especially on Manager.datetimes() introduced in django 1.6.dev

The issue seems known since Django 1.4 and will be resolved in Django 1.6 with the introduction of the .datetimes() method.

https://docs.djangoproject.com/en/1.5/ref/models/querysets/#dates
https://code.djangoproject.com/ticket/17260

I have tested your pull-request who seems working fine, but leads to 404 errors due to the same cause in the generic views, like described in the ticket 17260.

For all of these reasons, I won't apply the patch, and suggest to wait for the next release of Django, for having consistent results.

I hope that you will understand my reasons.

My best regards

Aaron Boman frenchtoast747 referenced this issue from a commit November 11, 2013
Aaron Boman Added fix from #222 and override Django's get_date_list method.
I took the fix from #222 and applied it to the `EntryArchiveMixin`. This solves issue #294. Ultimately, the problem lies with Django when using the `queryset.dates()` method and also using TZ aware datetimes.
5d31776
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.