Skip to content

Commit

Permalink
fixed sorting of struct_time fields (RBZ)
Browse files Browse the repository at this point in the history
  • Loading branch information
drfho authored Jun 14, 2022
1 parent 6aec6ee commit f6d8738
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Products/zms/_globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# Imports.
from Products.PageTemplates.Expressions import SecureModuleImporter
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
import time
import six
import sys

Expand Down Expand Up @@ -123,6 +124,8 @@ def validate(self, reference, attempt):
u'Я': 'JA',}

def sort_item( i):
if isinstance(i, time.struct_time):
i = time.strftime('%Y%m%d%H%M%S',i)
if isinstance(i, bytes):
i = i.decode('utf-8')
if isinstance(i, str):
Expand Down

0 comments on commit f6d8738

Please sign in to comment.