#27637: timeuntil, timesince breaks in leap year edge case
-------------------------------------+-------------------------------------
               Reporter:  felixxm    |          Owner:  felixxm
                   Type:  Bug        |         Status:  assigned
              Component:  Utilities  |        Version:  master
               Severity:  Normal     |       Keywords:  timeuntil timesince
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 `django.utils.timesince.timesince` and `django.utils.timesince.timeuntil`
 breaks in leap year edge case. Bug appeared after
 
[https://github.com/django/django/commit/6700c909358d2ff9ff96f28dbc549906d8d32206
 6700c909358d2ff9ff96f28dbc549906d8d32206]. If we take two dates from
 different years where one of them is leap and leap day is not between days
 gap then `timeuntil` returns incorrect result e.g.

 {{{timeuntil(datetime.date(2016, 12, 25), datetime.date(2017, 1, 1))}}}

 returns `1 week, 1 day != 1 week`.

--
Ticket URL: <https://code.djangoproject.com/ticket/27637>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.68f6e1f4ddc0bcc8ffe8022ca37c8934%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to