mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1934 (Would like to assign a year (not a full date) to a title)
This commit is contained in:
parent
18c39c6e20
commit
9c3062a4b5
@ -90,11 +90,11 @@ class DateDelegate(QStyledItemDelegate):
|
||||
def displayText(self, val, locale):
|
||||
d = val.toDate()
|
||||
return d.toString('dd MMM yyyy')
|
||||
if d.isNull():
|
||||
return ''
|
||||
d = datetime(d.year(), d.month(), d.day())
|
||||
return strftime(BooksView.TIME_FMT, d.timetuple())
|
||||
|
||||
def createEditor(self, parent, option, index):
|
||||
qde = QStyledItemDelegate.createEditor(self, parent, option, index)
|
||||
qde.setDisplayFormat('MM/dd/yyyy')
|
||||
return qde
|
||||
|
||||
class BooksModel(QAbstractTableModel):
|
||||
coding = zip(
|
||||
|
Loading…
x
Reference in New Issue
Block a user