Changeset 38:fb741bfe9e1d in stamper for stamper
- Timestamp:
- Aug 12, 2014, 6:44:42 PM (10 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stamper/stamper.py
r37 r38 237 237 return details, totals, total_customer 238 238 239 def timeline(self): 239 def timeline(self, stamp_filter=None): 240 filter_from, filter_to = self.validate_filter(stamp_filter) 240 241 for stamp in self.stamps: 241 242 customer = stamp['customer'] 243 start = datetime.strptime(stamp['start'], DATETIME_FORMAT) 244 start_day = start.strftime('%Y-%m-%d') 245 if filter_from and start < filter_from: 246 # if there is a filter setting a starting date for the 247 # report and the current stamp is from an earlier date, do 248 # not add it to the totals 249 continue 250 if filter_to and start > filter_to: 251 # similar for the end date 252 continue 242 253 if not stamp['customer']: 243 254 print(stamp['start'] + ' start')
Note:
See TracChangeset
for help on using the changeset viewer.