descending sort order on time stamp

This commit is contained in:
Helmut Merz 2014-04-19 11:46:19 +02:00
parent 2d2240244e
commit 2a532dba86
2 changed files with 8 additions and 1 deletions

View file

@ -217,6 +217,7 @@ class TrackDateField(Field):
fieldType = 'date' fieldType = 'date'
part = 'date' part = 'date'
format = 'short' format = 'short'
descending = False
cssClass = 'right' cssClass = 'right'
def getValue(self, row): def getValue(self, row):
@ -239,6 +240,12 @@ class TrackDateField(Field):
return '' return ''
return timeStamp2ISO(value)[:10] return timeStamp2ISO(value)[:10]
def getSortValue(self, row):
value = self.getRawValue(row)
if value and self.descending:
return -value
return value or None
class TrackTimeField(TrackDateField): class TrackTimeField(TrackDateField):

View file

@ -34,7 +34,7 @@ class CommentsOverview(ReportConceptView):
timeStamp = TrackDateField('timeStamp', u'Timestamp', timeStamp = TrackDateField('timeStamp', u'Timestamp',
description=u'The date and time the comment was posted.', description=u'The date and time the comment was posted.',
part='dateTime', part='dateTime', descending=True,
executionSteps=['sort', 'output']) executionSteps=['sort', 'output'])
target = TargetField('taskId', u'Target', target = TargetField('taskId', u'Target',
description=u'The resource or concept the comment was posted at.', description=u'The resource or concept the comment was posted at.',