Revision: 4161
Author: janne.t.harkonen
Date: Wed Sep 29 11:11:43 2010
Log: use ISO format for dates both in UI and DB
http://code.google.com/p/robotframework/source/detail?r=4161
Modified:
/trunk/proto/atdd-tutorial-berlin-2010/src/vacalc/employeestore.py
=======================================
--- /trunk/proto/atdd-tutorial-berlin-2010/src/vacalc/employeestore.py Wed
Sep 29 06:02:59 2010
+++ /trunk/proto/atdd-tutorial-berlin-2010/src/vacalc/employeestore.py Wed
Sep 29 11:11:43 2010
@@ -20,15 +20,10 @@
employees = {}
with open(path) as db:
for row in csv.reader(db):
- date = self._convert_date(row[1])
- employee = Employee(row[0], date)
+ employee = Employee(row[0], row[1])
employees[employee.name] = employee
return employees
- def _convert_date(self, isodate):
- year, month, day = isodate.split('-')
- return '%s.%s.%s' % (day, month, year)
-
def get_employee(self, name):
try:
return self._employees[name]
@@ -60,5 +55,5 @@
self.startdate = self._parse_date(startdate)
def _parse_date(self, datestring):
- day, month, year = datestring.split('.')
+ year, month, day = datestring.split('-')
return datetime.date(int(year), int(month), int(day))