Fix a regression in 2.8 that caused the clear button next to date fields to set the date to Jan 101 instead of undefined. Fixes #1388061 [clearing pubdate results in "0101" rather than "undefiined"](https://bugs.launchpad.net/calibre/+bug/1388061)

This commit is contained in:
Kovid Goyal 2014-10-31 17:57:46 +05:30
parent bf6165ebd2
commit 4c82321f66

View File

@ -172,7 +172,7 @@ def make_undoable(spinbox):
else:
self.undo_stack.clear()
if hasattr(self, 'setDateTime'):
if isinstance(val, date):
if isinstance(val, date) and not val == UNDEFINED_DATE:
val = parse_only_date(val.isoformat(), assume_utc=False)
self.setDateTime(val)
elif hasattr(self, 'setValue'):