Changeset 1220

Show
Ignore:
Timestamp:
08/11/08 17:41:46 (3 months ago)
Author:
mattknox_ca
Message:

fix bug when prevbusday called on a weekend returning incorrect date

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/timeseries/scikits/timeseries/tdates.py

    r1208 r1220  
    110110    If it is currently Saturday or Sunday, then the preceding Friday will be 
    111111    returned. If it is later than the specified ``day_end_hour`` and ``day_end_min``, 
    112     ``now('Business')`` will be returned.  
     112    ``now('Business')`` will be returned. 
    113113    Otherwise, ``now('Business')-1`` will be returned. 
    114114 
     
    117117    dateNum = tempDate.hour + float(tempDate.minute)/60 
    118118    checkNum = day_end_hour + float(day_end_min)/60 
    119     if dateNum < checkNum
     119    if dateNum < checkNum and tempDate.weekday() < 5
    120120        return now(_c.FR_BUS) - 1 
    121121    else: 
     
    185185    When viewed element-wise, DateArray is a sequence of dates. 
    186186    For example, a test such as : 
    187      
     187 
    188188    >>> DateArray(...) = value 
    189      
     189 
    190190    will be valid only if value is an integer, not a Date 
    191191    However, a loop such as : 
    192      
     192 
    193193    >>> for d in DateArray(...): 
    194      
     194 
    195195    accesses the array element by element. Therefore, `d` is a Date object. 
    196196    """ 
     
    411411    def asfreq(self, freq=None, relation="END"): 
    412412        """ 
    413      
     413 
    414414    Converts the dates to another frequency. 
    415415