Fix #4829 (Weird date format)

This commit is contained in:
Kovid Goyal 2010-02-08 14:52:00 -07:00
parent cf5ca45531
commit 8700214dc6
2 changed files with 4 additions and 2 deletions

View File

@ -97,7 +97,10 @@ class DateDelegate(QStyledItemDelegate):
def createEditor(self, parent, option, index):
qde = QStyledItemDelegate.createEditor(self, parent, option, index)
qde.setDisplayFormat(unicode(qde.displayFormat()).replace('yy', 'yyyy'))
stdformat = unicode(qde.displayFormat())
if 'yyyy' not in stdformat:
stdformat = stdformat.replace('yy', 'yyyy')
qde.setDisplayFormat(stdformat)
qde.setMinimumDate(QDate(101,1,1))
qde.setCalendarPopup(True)
return qde

View File

@ -331,7 +331,6 @@ class Document(QWebPage):
elem = self.find_bookmark_element()
if elem is None or self.element_ypos(elem) < 100:
print elem, self.element_ypos(elem)
bm = 'body|%f'%(float(self.ypos)/(self.height*0.7))
else:
bm = unicode(elem.evaluateJavaScript(