diff --git a/ChangeLog b/ChangeLog index a68c0b5a1..c4373560d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -172,6 +172,8 @@ Black Ops Testing). - TW-1422 Attempt to modify 'id' attribute creates an id attribute (thanks to Black Ops Testing). +- TW-1423 Using the date February 29th, in a non leap year does not fail well + (thanks to Black Ops Testing). - TW-1424 Using a date of '1824days' (in the future) fails (thanks to Black Ops Testing). - TW-1428 Add support for color.uda.. rules. diff --git a/src/Task.cpp b/src/Task.cpp index 3896bd11d..6d1bdb34d 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -2008,6 +2008,11 @@ void Task::modify (modType type, bool text_required /* = false */) context.debug (label + name + " <-- '" + format ("{1}", v.get_date ()) + "' <-- '" + (std::string) v + "' <-- '" + value + "'"); } + // If a date doesn't parse (2/29/2014) then it evaluates to zero. + if (value != "" && + v.get_date () == 0) + throw format (STRING_DATE_INVALID_FORMAT, value, Variant::dateFormat); + set (name, v.get_date ()); ++modCount; } diff --git a/test/bug.360.t b/test/bug.360.t index 1b6f336ba..6a4b16a02 100755 --- a/test/bug.360.t +++ b/test/bug.360.t @@ -99,8 +99,7 @@ class TestBug360AllowedChanges(BaseTestBug360): self.t(("add", "nonrecurring", "due:today")) def test_allow_modify_due_in_nonrecurring(self): - """Allow modifying due date in non recurring task - """ + """Allow modifying due date in non recurring task""" # Retrieve the id of the non recurring task args = ("ls",) code, out, err = self.t(args)