Roundup Tracker - Issues

Issue 853345

classification
reldate() prints yesterday as "tomorrow"
Type: Severity: normal
Components: Web interface Versions:
process
Status: closed fixed
:
: richard : richard
Priority: normal :

Created on 2003-12-03 15:17 by anonymous, last changed 2003-12-04 02:32 by richard.

Messages
msg1070 Author: [hidden] (anonymous) Date: 2003-12-03 15:17
From: ron_dagostino@ssga.com

This affectes what you see in the GUI -- something with 
activity yesterday actually shows activity 
as "tomorrow", which is counter-intuitive.

>>> from roundup.date import Date
>>> from roundup.cgi.templating import 
DateHTMLProperty
>>> client = Date('.')
>>> client.db = 1
>>> y = DateHTMLProperty(client, None, None, None, 
None, Date('-1d'))
>>> y.reldate()
'tomorrow'         <<<<<<<<<<<<<<<<<<<<
>>>


Here is a patch to the reldate() method of templating.py:

diff templating.py~ templating.py
1054c1054
<         interval = date.Date('.') - self._value
---
>         interval = self._value - date.Date('.')
bash-2.05b$ 

>>> from roundup.date import Date
>>> from roundup.cgi.templating import 
DateHTMLProperty
>>> client = Date('.')
>>> client.db = 1
>>> y = DateHTMLProperty(client, None, None, None, 
None, Date('-1d'))
>>> y.reldate()
'yesterday'       <<< Fixed, plus the GUI is now correct
>>>
msg1071 Author: [hidden] (richard) Date: 2003-12-04 02:32
Logged In: YES 
user_id=6405

Thanks for the report. It's a dupe :) 
 
History
Date User Action Args
2003-12-03 15:17:40anonymouscreate