This commit is contained in:
Kovid Goyal 2011-11-18 22:08:26 +05:30
commit b2641d5941
2 changed files with 7 additions and 2 deletions

View File

@ -372,13 +372,13 @@ class MetadataBulkDialog(ResizableDialog, Ui_MetadataBulkDialog):
self.apply_pubdate.setChecked(True) self.apply_pubdate.setChecked(True)
def clear_pubdate(self, *args): def clear_pubdate(self, *args):
self.pubdate.setMinimumDateTime(UNDEFINED_QDATETIME) self.pubdate.setDateTime(UNDEFINED_QDATETIME)
def do_apply_adddate(self, *args): def do_apply_adddate(self, *args):
self.apply_adddate.setChecked(True) self.apply_adddate.setChecked(True)
def clear_adddate(self, *args): def clear_adddate(self, *args):
self.adddate.setMinimumDateTime(UNDEFINED_QDATETIME) self.adddate.setDateTime(UNDEFINED_QDATETIME)
def button_clicked(self, which): def button_clicked(self, which):
if which == self.button_box.button(QDialogButtonBox.Apply): if which == self.button_box.button(QDialogButtonBox.Apply):

View File

@ -291,6 +291,11 @@ def clean_date_for_sort(dt, format):
if not isinstance(dt, datetime): if not isinstance(dt, datetime):
dt = datetime.combine(dt, time()) dt = datetime.combine(dt, time())
if hasattr(dt, 'tzinfo'):
if dt.tzinfo is None:
dt = dt.replace(tzinfo=_local_tz)
dt = as_local_time(dt)
if format == 'iso': if format == 'iso':
format = 'yyMdhms' format = 'yyMdhms'