#2975: [patch] parseDateString function in dateparse.js return wrong date for '
2006-12-31'
----------------------------------+-----------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: adrian
Status: reopened | Component: Admin interface
Version: SVN | Resolution:
Keywords: | Stage: Unreviewed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
----------------------------------+-----------------------------------------
Changes (by [EMAIL PROTECTED]):
* cc: [EMAIL PROTECTED] (added)
* status: closed => reopened
* resolution: fixed =>
Comment:
The [http://code.djangoproject.com/attachment/ticket/2975/dateparse.patch
previous patch] is an incomplete fix. In addition, the scope of this issue
extends further than the message for [4032] indicates.
This problem manifests itself because months have different number of days
and !JavaScript automatically rolls over when modifying date objects if
there are days past the max day of that month. (e.g. Feb 15, 2007 -> Jan
31, 2007 and vice versa)
The root of the problem is the order in which the !JavaScript data object
is modified. To get consistent results when changing the entire date
object, it's important to set the date in this manner:
1. set day to 1 (any day that exists in all months is fine too)
2. set year
3. set month
4. set day
Please reference the
[http://code.djangoproject.com/attachment/ticket/2975/dateparse.js.diff
attached patch].
--
Ticket URL: <http://code.djangoproject.com/ticket/2975#comment:2>
Django Code <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
-~----------~----~----~----~------~----~------~--~---