#31711: WeekArchiveView seens to be zero based for week, instead of one based
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
RichardZimmerEschborn |
Type: Uncategorized | Status: closed
Component: Generic views | Version: 2.2
Severity: Normal | Resolution: invalid
Keywords: ArchiveView, Week, | Triage Stage:
bug | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by felixxm):
> Well, then the documantation is wrong too!
I don't any issue in docs. Can you be more precise? (also please don't
shout)
> If I want to access the archive of the first week of a year, I call the
link /year/1 and I expect to receive the data for this year and week numer
one. But what I get is this year and week+1.
>
> Or the other way, the user calls the webpage /2020/24, but gets a page
for 2020/25. The page displays the data for week 25 and it has the title
of week 25, Is this the expected result of a SEO friendly link?
If you're talking about an example from
[https://docs.djangoproject.com/en/dev/ref/class-based-views/generic-date-
based/#weekarchiveview docs], then this behavior is documented:
> ''"In this example, you are outputting the week number. Keep in mind
that week numbers computed by the date template filter with the 'W' format
character are not always the same as those computed by strftime() and
strptime() with the '%W' format string. For year 2015, for example, week
numbers output by date are higher by one compared to those output by
strftime(). There isn’t an equivalent for the '%U' strftime() format
string in date. Therefore, you should avoid using date to generate URLs
for WeekArchiveView."''
--
Ticket URL: <https://code.djangoproject.com/ticket/31711#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/079.d0db6f36e703586597942d5005c29801%40djangoproject.com.