Changeset e9b1d7 in indico


Ignore:
Timestamp:
01/26/12 16:16:32 (16 months ago)
Author:
Pedro Ferreira <jose.pedro.ferreira@…>
Branches:
master, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 0da0c1403bae8e51d8229f460181c71b9e6dda72
Children:
4e0be3
Parents:
f77e30
git-author:
Matthew Pugh <matthew.alexander.pugh@…> (01/12/12 09:56:09)
git-committer:
Pedro Ferreira <jose.pedro.ferreira@…> (01/26/12 16:16:32)
Message:

[FIX] VSO - Relative dates now disregard HH:MM

  • Modified from days to always start at 00:00 on date.
  • Modified to days to always end at 23:59 on date.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/services/implementation/collaboration.py

    r9f94a3c re9b1d7  
    303303                if self._params['toTitle']: 
    304304                    maxKey = self._params['toTitle'].strip() 
     305 
     306                """ For relative dates, create a diff timedelta for resetting to  
     307                    00:00 at the start of range and 23:59 at the end. 
     308                """ 
    305309                if self._params['fromDays']: 
    306310                    try: 
     
    308312                    except ValueError, e: 
    309313                        raise CollaborationException(_("Parameter 'fromDays' is not an integer"), inner = e) 
    310                     minKey = nowutc() - timedelta(days = fromDays) 
     314                    now = nowutc() 
     315                    diff = timedelta(hours = now.hour, minutes = now.minute, seconds = now.second) 
     316                    minKey = now - diff - timedelta(days = fromDays) 
    311317                if self._params['toDays']: 
    312318                    try: 
     
    314320                    except ValueError, e: 
    315321                        raise CollaborationException(_("Parameter 'toDays' is not an integer"), inner = e) 
    316                     maxKey = nowutc() + timedelta(days = toDays) 
     322                    now = nowutc() 
     323                    diff = timedelta(days = 1) - \ 
     324                           timedelta(hours = now.hour, minutes = now.minute, seconds = (now.second + 1)) 
     325                    maxKey = now + diff + timedelta(days = toDays) 
    317326 
    318327                self._minKey = minKey 
Note: See TracChangeset for help on using the changeset viewer.