Opened 19 years ago
Closed 18 years ago
#2675 closed defect (fixed)
using timeuntil template filter on a past date results in random number of milliseconds
| Reported by: | Owned by: | Nick Efford | |
|---|---|---|---|
| Component: | Template system | Version: | dev |
| Severity: | normal | Keywords: | sprintsept14 |
| Cc: | gary.wilson@… | Triage Stage: | Accepted |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
It should instead display "0 seconds" or something of the sort.
Attachments (2)
Change History (9)
comment:1 by , 19 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 18 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:3 by , 18 years ago
comment:4 by , 18 years ago
The attached patch fixes django.utils.timesince.timesince so that negative time intervals are rendered as "0 minutes", and amends the template documentation accordingly. I've added suitable tests, and these are provided as the attached zipfile. (Unzipping this file in the top-level directory should create a timesince directory under regressiontests.)
by , 18 years ago
| Attachment: | timesince.diff added |
|---|
Patch for django.utils.timesince and template docs
comment:5 by , 18 years ago
| Has patch: | set |
|---|
comment:6 by , 18 years ago
| Keywords: | sprintsept14 added |
|---|
comment:7 by , 18 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
Looking at
django.utils.timesince, I discover that calling thetimesincefunction on a time in the near future or thetimeuntilfunction on a time in the near past both yield the result'-1 years 12 months'.