Fix clicking on an empty published field in the book list to edit it setting the initial date to Jan 2000 instead of today's date

This commit is contained in:
Kovid Goyal 2019-02-10 15:46:45 +05:30
parent 637ddf7d4e
commit ea99a041d3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -300,7 +300,7 @@ class PubDateDelegate(QStyledItemDelegate, UpdateEditorGeometry): # {{{
elif check_key_modifier(Qt.ShiftModifier + Qt.ControlModifier):
val = now()
elif is_date_undefined(val):
val = QDate(2000, 1, 1)
val = QDate.currentDate()
if isinstance(val, QDateTime):
val = val.date()
editor.setDate(val)