From 4c82321f66010bde09830d1a49c82c9a0b5ddfc8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 31 Oct 2014 17:57:46 +0530 Subject: [PATCH] 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) --- src/calibre/gui2/metadata/basic_widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/metadata/basic_widgets.py b/src/calibre/gui2/metadata/basic_widgets.py index ba33d2349b..694f71eea2 100644 --- a/src/calibre/gui2/metadata/basic_widgets.py +++ b/src/calibre/gui2/metadata/basic_widgets.py @@ -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'):