diff --git a/test/test_trello.py b/test/test_trello.py index 5216e8fe..8de4056a 100644 --- a/test/test_trello.py +++ b/test/test_trello.py @@ -226,6 +226,8 @@ def test52_add_card_set_due(self): card.fetch() actual_due_date = card.due[:10] self.assertEquals(expected_due_date, actual_due_date) + # Note that set_due passes only the date, stripping time + self.assertEquals(card.due_date.date(), due_date.date()) def test53_checklist(self): name = "Testing from Python" diff --git a/trello/__init__.py b/trello/__init__.py index d75c8b16..0fe4497b 100644 --- a/trello/__init__.py +++ b/trello/__init__.py @@ -764,6 +764,10 @@ def create_date(self): date_str = self.actions[0]['date'][:-5] return datetime.strptime(date_str, '%Y-%m-%dT%H:%M:%S') + @property + def due_date(self): + return dateparser.parse(self.due) + def set_name(self, new_name): """ Update the name on the card to :new_name: