Code

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#977 closed defect (fixed)

[patch] timesince() method is broken when now argument is passed

Reported by: pgross@… Owned by: adrian
Component: Core (Other) Version:
Severity: major Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The timesince() method in django.utils.timesince is broken when the now argument is passed. The code

if now:
    t = time.mktime(now)

returns a float, but the code below clearly expects a tuple. Also, the timeuntil() method passes now as a float. Perhaps it should be a tuple or a datetime object.

Attachments (1)

timesince.diff (557 bytes) - added by pgross@… 8 years ago.

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by pgross@…

comment:1 Changed 8 years ago by pgross@…

  • Summary changed from timesince() method is broken when now argument is passed to [patch] timesince() method is broken when now argument is passed

comment:2 Changed 8 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(In [1579]) Fixed #977 -- Fixed timesince() utility. Thanks, pgross@…

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.