Opened 5 years ago

Closed 4 years ago

#31620 closed New feature (fixed)

Support "%V" format in WeekArchiveView.

Reported by: Jakub Jagielka Owned by: Hasan Ramezani
Component: Generic views Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

#26217 (Docs for WeekArchiveView are misleading about %W) - closed 4 years ago mentioned support for %V week format.

Since python 3.6, %G, %u and %V ISO 8601 formatters were added to strptime.

WeekArchiveView should add %V to the list of accepted week formatters. This would require as well the special case to change the year format to %G, or simply ValueError in _date_from_string should mention the message passed from datetime.datetime.strptime:

ISO week directive '%V' is incompatible with the year directive '%Y'. Use the ISO year '%G'.

Change History (7)

in reply to:  description comment:1 by Mariusz Felisiak, 5 years ago

Summary: WeekArchiveView '%V' supportSupport "%V" format in WeekArchiveView.
Triage Stage: UnreviewedAccepted
Version: 3.0master

comment:2 by Omkar Kulkarni, 5 years ago

Owner: changed from nobody to Omkar Kulkarni
Status: newassigned

comment:3 by Hasan Ramezani, 4 years ago

Has patch: set
Owner: changed from Omkar Kulkarni to Hasan Ramezani

in reply to:  3 comment:4 by Jakub Jagielka, 4 years ago

Patch needs improvement: set

Replying to Hasan Ramezani:

Unfortunately the implementation is wrong. ISO weeks start on Monday.

https://en.wikipedia.org/wiki/ISO_week_date

comment:5 by Hasan Ramezani, 4 years ago

Patch needs improvement: unset

comment:6 by Mariusz Felisiak, 4 years ago

Triage Stage: AcceptedReady for checkin

comment:7 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

Resolution: fixed
Status: assignedclosed

In 8984cab:

Fixed #31620 -- Added support for %V format to WeekMixin/WeekArchiveView.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@…>

Note: See TracTickets for help on using tickets.
Back to Top