#3189: [patch] generic date_based view, allowing week to start on monday
---------------------------------------------+------------------------------
Reporter: [EMAIL PROTECTED] | Owner: nobody
Status: new | Milestone:
Component: Generic views | Version: SVN
Resolution: | Keywords:
Stage: Design decision needed | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------+------------------------------
Comment (by jgomo3):
Replying to [comment:1 [EMAIL PROTECTED]:
Justo to comment that the format of strptime support a directive to
express the number of a week with monday beeing the first day of the week:
it is %W. So, if week_starts_monday is False the line wich define tha
local var date states unchanged like this:
{{{
date = datetime.date(*time.strptime(year+'-0-'+week, '%Y-%w-%U')[:3])
}}}
but if week_starts_monday is True, it can be changed to:
{{{
date = datetime.date(*time.strptime(year+'-0-'+week, '%Y-%w-%W')[:3])
}}}
I think it is cleaner than adding a day to date.
--
Ticket URL: <http://code.djangoproject.com/ticket/3189#comment:6>
Django <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---