wilsonfreitas / python-bizdays

Business days calculations and utilities
http://wilsonfreitas.github.io/python-bizdays/
MIT License
80 stars 34 forks source link

Calendar's start and end dates #4

Closed wilsonfreitas closed 11 years ago

wilsonfreitas commented 11 years ago

The start and end dates should be passed in the constructor, instead of trying to guess. The rule is use the first and last dates of the given calendar spec or use whatever is passed.

wilsonfreitas commented 11 years ago

It's done. Calendar now handles start and end dates

    cal = Calendar('Test', enddate='2013-01-05')
    self.assertEqual(cal.enddate.isoformat(), '2013-01-05')
    self.assertEqual(cal.index[cal.enddate], (3132, 4388, True))
    cal = Calendar('Test', startdate='2000-01-01')
    self.assertEqual(cal.startdate.isoformat(), '2000-01-01')
    self.assertEqual(cal.index[cal.startdate], (1, 1, True))