Changeset 25:8e33103a7e36 in stamper


Ignore:
Timestamp:
Jul 30, 2014, 4:27:41 PM (10 years ago)
Author:
Borja Lopez <borja@…>
Branch:
default
Phase:
public
Message:

Set two _FORMAT variables for DATE and DATETIME objects.
This naming is more consistent, now that we use both date and
datetime objects.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stamper/stamper.py

    r24 r25  
    99
    1010STAMPS_FILE = expanduser('~/.workstamps.json')
    11 DATE_FORMAT = '%Y-%m-%d %H:%M'
     11DATE_FORMAT = '%Y-%m-%d'
     12DATETIME_FORMAT = '%Y-%m-%d %H:%M'
    1213HOURS_DAY = 8
    1314SECS_DAY = HOURS_DAY * 60 * 60
     
    5152
    5253    def worktime(self, start, end):
    53         worktime = (datetime.strptime(end, DATE_FORMAT) -
    54                     datetime.strptime(start, DATE_FORMAT))
     54        worktime = (datetime.strptime(end, DATETIME_FORMAT) -
     55                    datetime.strptime(start, DATETIME_FORMAT))
    5556        return worktime.seconds
    5657
Note: See TracChangeset for help on using the changeset viewer.